2017-04-03 16 views
0

使用快遞節點測試覆蓋W伊斯坦布爾酒店/摩卡錯誤:ENOENT:沒有這樣的文件或目錄node_modules /伊斯坦布爾報道/ lib中/ HTML /資產

"babel-cli": "6.18.0", 
"babel-core": "6.18.0", 
"babel-plugin-add-module-exports": "0.2.1", 
"babel-preset-es2015": "6.16.0", 
"babel-preset-stage-2": "6.18.0", 

"coveralls": "^2.13.0", 
"istanbul": "1.1.0-alpha.1", 
"mocha": "3.2.0", 

當我運行該腳本

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

所有測試都通過

... 
15 passing (904ms) 

,但我得到來自伊斯坦布爾的報告模塊錯誤,任何提示歡迎...

fs.js:871 
    return binding.readdir(pathModule._makeLong(path), options.encoding); 
       ^

Error: ENOENT: no such file or directory, scandir '..myApp/node_modules/istanbul-reports/lib/html/assets' 
    at Object.fs.readdirSync (fs.js:871:18) 
    at copyAssets (..myApp/node_modules/istanbul-reports/lib/html/index.js:156:16) 
    at ..myApp/node_modules/istanbul-reports/lib/html/index.js:173:9 
    at Array.forEach (native) 
    at HtmlReport.onStart (..myApp/node_modules/istanbul-reports/lib/html/index.js:172:21) 
    at LcovReport.(anonymous function) [as onStart] (..myApp/node_modules/istanbul-reports/lib/lcov/index.js:24:24) 
    at Visitor.(anonymous function) [as onStart] (..myApp/node_modules/istanbul-lib-report/lib/tree.js:34:30) 
    at Tree.visit (..myApp/node_modules/istanbul-lib-report/lib/tree.js:157:13) 
    at ..myApp/node_modules/istanbul-api/lib/reporter.js:84:18 
    at Array.forEach (native) 
    at Reporter.write (..myApp/node_modules/istanbul-api/lib/reporter.js:82:35) 
    at exitFn (..myApp/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 (..myApp/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. 

回答

0

解決...

我錯過了伊斯坦布爾在我的腳本的--report選項!

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