-1

I am using istanbul for my code coverage. The summary is printed successfully but i am getting error after that.

Command:

istanbul cover --print detail node_modules/mocha/bin/_mocha -- ./*

Output:

=============================================================================
Writing coverage object [E:\Node-Mocha\coverage\coverage.json]
Writing coverage reports at [E:\Node-Mocha\coverage]
=============================================================================
-------------|----------|----------|----------|----------|----------------|
File         |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
-------------|----------|----------|----------|----------|----------------|
 Node-Mocha\ |    66.67 |      100 |        0 |    66.67 |                |
  app.js     |    66.67 |      100 |        0 |    66.67 |           7,12 |
-------------|----------|----------|----------|----------|----------------|
All files    |    66.67 |      100 |        0 |    66.67 |                |
-------------|----------|----------|----------|----------|----------------|

module.js:549
    throw err;
    ^

Error: Cannot find module 'E:\Node-Mocha\coverage'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at E:\Node-Mocha\node_modules\mocha\lib\mocha.js:250:27
    at Array.forEach (<anonymous>)
    at Mocha.loadFiles (E:\Node-Mocha\node_modules\mocha\lib\mocha.js:247:14)
    at Mocha.run (E:\Node-Mocha\node_modules\mocha\lib\mocha.js:576:10)
    at Object.<anonymous> (E:\Node-Mocha\node_modules\mocha\bin\_mocha:637:18)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)

Why that error is thrown?? Please share your ideas.

After Generating the report why its looking for coverage folder in my project directory??

Subburaj
  • 5,114
  • 10
  • 44
  • 87

1 Answers1

0

have you tried removing all node_modules and npm install again?

Lazar Nikolic
  • 4,261
  • 1
  • 22
  • 46