Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't cover with mocha when using mock-fs #692

Closed
fiws opened this issue Aug 30, 2016 · 2 comments
Closed

can't cover with mocha when using mock-fs #692

fiws opened this issue Aug 30, 2016 · 2 comments

Comments

@fiws
Copy link

fiws commented Aug 30, 2016

Hi I am using this command istanbul cover _mocha -- -u exports -R spec test/**/*.js

and getting this error:

 "stack": [
   "Error: ENOENT, no such file or directory '/home/fiws/npm/lib/node_modules/istanbul/lib/assets'",
   "    at Binding.<anonymous> (/home/fiws/project/node_modules/mock-fs/lib/binding.js:604:13)",
   "    at maybeCallback (/home/fiws/project/node_modules/mock-fs/lib/binding.js:43:17)",
   "    at Binding.readdir (/home/fiws/project/node_modules/mock-fs/lib/binding.js:596:10)",
   "    at Object.fs.readdirSync (/home/fiws/project/node_modules/mock-fs/node/fs-6.3.0.js:909:18)",
   "    at Object.readdirSync (/home/fiws/project/node_modules/mock-fs/lib/index.js:59:31)",
   "    at copyAssets (/home/fiws/npm/lib/node_modules/istanbul/lib/report/html.js:543:20)",
   "    at /home/fiws/npm/lib/node_modules/istanbul/lib/report/html.js:562:13",
   "    at Array.forEach (native)",
   "    at HtmlReport.writeReport (/home/fiws/npm/lib/node_modules/istanbul/lib/report/html.js:561:26)",
   "    at LcovReport.writeReport (/home/fiws/npm/lib/node_modules/istanbul/lib/report/lcov.js:55:19)",
   "    at /home/fiws/npm/lib/node_modules/istanbul/lib/reporter.js:93:20",
   "    at Array.forEach (native)",
   "    at Object.write (/home/fiws/npm/lib/node_modules/istanbul/lib/reporter.js:87:30)",
   "    at process.<anonymous> (/home/fiws/npm/lib/node_modules/istanbul/lib/command/common/run-with-cover.js:249:30)",
   "    at process.g (events.js:286:16)",
   "    at emitOne (events.js:96:13)",
   "    at process.emit (events.js:188:7)",
   "    at process.exit (internal/process.js:146:15)",
   "    at done (/home/fiws/npm/lib/node_modules/mocha/bin/_mocha:416:32)",
   "    at afterWrite (_stream_writable.js:361:3)",
   "    at _combinedTickCallback (internal/process/next_tick.js:80:20)",
   "    at process._tickCallback (internal/process/next_tick.js:98:9)"
 ],
 "level": "error",
 "message": "uncaughtException: ENOENT, no such file or directory '/home/fiws/npm/lib/node_modules/istanbul/lib/assets'",
 "timestamp": "2016-08-30T07:51:25.280Z"

and the process hangs.
Seems to be related to mock-fs used by the tests..

@fiws fiws changed the title can't cover with mocha can't cover with mocha when using mock-fs Sep 6, 2016
@fiws
Copy link
Author

fiws commented Sep 6, 2016

probably project related.

@fiws fiws closed this as completed Sep 6, 2016
@simeg
Copy link

simeg commented Nov 13, 2016

Are you calling mock.restore() in the tear down method? See the first example in the mock-fs README and this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants