WORK IN PROGRESS - DO NOT USE YET
Purefuncs
Automatically extract pure functions from your javascript code for unit testing.
Installation
npm install --save purefuncs
cli usage
Given:
// file: src/example.jsconst z = 2; { const x = 3 + z; { const f = 5 + asd; return x + 1; } { return x + math; }}
Run :
$ purefuncs src/example.js -o test/purefuncs/example.js
Output:
// file: test/purefuncs/example.jsconst foo = { const x = 3 + z; { const f = 5 + asd; return x + 1; } { return x + math; }} const foo$bla = { const f = 5 + asd; return x + 1;} const foo$tada = { return x + math;}
License
MIT