Native Test Init
This command will set up Node's native test runner, with coverage support, under the package script node:test
.
There is no installation necessary. To use it:
npx '@fordi-org/test-init'
Installing c8
Creating .c8rc (test reporter config) with basic defaults
Adding test runner script
This is equivalent to:
- Running
npm i -D c8
- Creating
.c8rc
with the content:{ "reporter": [ "html" ], "all": true, "reportDir": "./coverage", "src": ".", "include": [ "*", "**/*" ], "exclude": [ "coverage/**/*", "*.test/**/*", "**/*.test*" ], "checkCoverage": true, "lines": 75, "functions": 75, "statements": 75, "branches": 75 }
- Adding the script
"node:test": "c8 -- node --test"