Monday, 8 May 2017

node mocha test coverage with Istanbul : error on cover --report html

when running test coverage, if I use the cover --report html,

 "test:v1:coverage": "cross-env NODE_ENV=test ./node_modules/.bin/istanbul 
 cover --report json --report text --report html 
_mocha -- --ui bdd --reporter spec --colors 
 --compilers js:babel-core/register server/v1/tests --recursive",

I get an error w the ..ode_modules/istanbul-reports/lib/html/asset

    Error: ENOENT: no such file or directory, scandir '/Users/yves/Developments/IDEALCOMS/project/api-cockpit/node_modules/istanbul-reports/lib/html/assets'
        at Object.fs.readdirSync (fs.js:871:18)
        at copyAssets (/Users/yves/Developments/IDEALCOMS/project/api-cockpit/node_modules/istanbul-reports/lib/html/index.js:156:16)
        at /Users/yves/Developments/IDEALCOMS/project/api-cockpit/node_modules/istanbul-reports/lib/html/index.js:173:9
        at Array.forEach (native)
        at HtmlReport.onStart (/Users/yves/Developments/IDEALCOMS/project/api-cockpit/node_modules/istanbul-reports/lib/html/index.js:172:21)
        at Visitor.(anonymous function) [as onStart] (/Users/yves/Developments/IDEALCOMS/project/api-cockpit/node_modules/istanbul-lib-report/lib/tree.js:34:30)
        at Tree.visit (/Users/yves/Developments/IDEALCOMS/project/api-cockpit/node_modules/istanbul-lib-report/lib/tree.js:157:13)
        at /Users/yves/Developments/IDEALCOMS/project/api-cockpit/node_modules/istanbul-api/lib/reporter.js:84:18
        at Array.forEach (native)
        at Reporter.write (/Users/yves/Developments/IDEALCOMS/project/api-cockpit/node_modules/istanbul-api/lib/reporter.js:82:35)
        at exitFn (/Users/yves/Developments/IDEALCOMS/project/api-cockpit/node_modules/istanbul-api/lib/run-cover.js:169:18)
        at Object.onceWrapper (events.js:290:19)
        at emitOne (events.js:101:20)
        at process.emit (events.js:188:7)
        at process.exit (internal/process.js:147:15)
        at done (/Users/yves/Developments/IDEALCOMS/project/api-cockpit/node_modules/mocha/bin/_mocha:474:15)
        at afterWrite (_stream_writable.js:386:3)
        at _combinedTickCallback (internal/process/next_tick.js:80:20)
        at process._tickCallback (internal/process/next_tick.js:98:9)
    error Command failed with exit code 1.



via erwin

No comments:

Post a Comment