1.2.0 • Published 5 years ago
entro-jest-flags v1.2.0
entro-jest-flags
A CLI that allows us to generate flags for jest form a json file. This can be used to change flags in conjunction with nodemon.
Usage
If you create a .json file with the following entries,
config.json:
{
"namePattern": "name pattern",
"pathPattern": "path pattern"
}And then you run, entro-jest-flags config.json, the output will be:
--testNamePattern="name pattern" --testPathPattern="path pattern"So using nodemon, we can rerun jest tests using:
nodemon --watch=./config.json --exec npm run testAnd then set the test script in your package.json to:
jest $(entro-jest-flags ./config.json) --watchAll --verbose$ npm install -g entro-jest-flags
$ entro-jest-flags COMMAND
running command...
$ entro-jest-flags (-v|--version|version)
entro-jest-flags/1.1.1 linux-x64 node-v14.15.0
$ entro-jest-flags --help [COMMAND]
USAGE
$ entro-jest-flags COMMAND
...