Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

No coverage information was collected, exit without writing coverage information #798

Closed
dschinkel opened this issue Apr 9, 2017 · 2 comments

Comments

@dschinkel
Copy link

dschinkel commented Apr 9, 2017

I've spent hours on this. Cannot get past this infamous error.

https://github.com/dschinkel/we-do-tdd-service

I'm running this which runs fine in terms of the test passing, but immediately after the test passes I get that error still:

npm run build && ./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha \"./dist/test/**/*.spec.js\" --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf coverage

You can clone it and just try npm run coverage to see the error.

Just makes no sense to me why this would not work. I want this to work without resorting to babel-node or babel-instanbul

UPDATE

this works but I had to cd into my dist/test directory first for some reason. I'd like not to have to do that, and to get the first working. Thoughts?

npm run build && cd ./dist/test && istanbul cover ../../node_modules/.bin/_mocha \"./**/*.spec.js\" --report lcovonly -- -R spec && cat ./coverage/lcov.info | ../../node_modules/coveralls/bin/coveralls.js && rm -rf ../../coverage
@dschinkel
Copy link
Author

resolved, there was something wrong with my path for my test file. When I moved the test file to root and change my script to look for the .spec.js in root it worked so....that's what it was. It's weird because that path to dist/test did run my tests, mocha did run it, but for some reason, istanbul didn't like that path for whatever reason, it couldn't report coverage on dist/test

@LanmeijingLucky
Copy link

Moving the test.js file on root, it worked

 istanbul cover _mocha t_1.js

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

No branches or pull requests

2 participants