I have a build/
folder that gets autogenerated by a babel process in a package.json
. It has several .js files, including in sub-folders. In the root is a file, main.js
, which is something of a demo / testbed for the project, that instantiates various ES6 classes and tries out various functions. It currently runs without crashing.
Call it a poor man's end-2-end test. I'm trying to move quickly with what could be throw away code.
I don't have any formal tests. I don't want to write any formal tests for this codebase. But I am interested in knowing how much of the code in build/
is being touched currently by my demo, main.js
.
- How can I generate a code coverage report for this scenario, using
nyc
? - If that's not actually easy (all tutorials I see seem to involve instrumenting pre-existing unit tests from a mainstream testing framework), what nyc alternative would make this easy?
I tried
npm install nyc --save-dev
npx nyc node build/main.js
but it claimed 0 lines/files.