Platelunch
Intro
Platelunch generates boilerplate unit test code for javascript source files. Currently it will generate unit test files to be used with jest only. More testing frameworks will be supported.
Install
npm install --save-dev platelunch --- or globally npm install -g platelunch
CLI
platelunch opts filename ...
Platelunch will create a directory __tests__
where all the generated unit test files will be created.
WARNING If a test file exists in __tests__
it will be overwritten unless the glob or filename does not include that file.
Using glob to find files to generate unit tests
platelunch --test-framework jest "src/**/*.js"
Only one unit test file will be generated
platelunch --test-framework jest "src/my-file.js"
Examples
module.exports
Source File
{ return num1 + num2;} moduleexports = add: add;
Generated unit test file
const add = add; ;
exports
Source File
{ return num1 + num2;} ;
Generated unit test file
;
class (ES2015)
Source File
{ return num1 + num2; };
Generated unit test file
; ;
Licensing
The code in this project is licensed under MIT license.