I have a project with two typescript files:
- src/index.ts
- src/index.spec.ts
I can run the mocha unit tests without first compiling the typescript to commonjs format like this:
mocha -r ts-node/register src/**/*.spec.ts
I'd also like to run istantbul and I tried this:
istanbul cover node_modules/mocha/bin/_mocha -r ts-node/register src/**/*.spec.ts - - -R spec
I got that snippet from this article (It's tweaked to support ts-node
.
When istanbul cover
is ran like that the result is:
> @fsngx/ease@1.0.0 cover /home/ole/fsngx/ease
> istanbul cover node_modules/mocha/bin/_mocha -r ts-node/register src/**/*.spec.ts - - -R spec
Warning: Could not find any test files matching pattern: ts-node/register
Warning: Could not find any test files matching pattern: -
Is it possible to run istanbul cover
using ts-node
or do we need to run that command on compiled typescript?