Open abresas opened 8 years ago
Hi @abresas - I'll have a look at this when I'm back in the office on Tuesday the 5th. Happy holidays!
-Jason
Also having this problem, which was fixed by https://github.com/abresas/register-coffee-coverage/blob/master/index.js#L5
coffee-coverage replaces require.extensions['.coffee'] to handle .coffee file compilations itself.
during tests, one of my submodules was requiring coffee-script/register, which led to the original coffee-script handler to compile the files, and coffee-coverage not instrumenting them.
I suspect that this is faced by other users as well. For example the user facing the issue https://github.com/benbria/coffee-coverage/issues/55 uses sprout which has this code https://github.com/carrot/sprout/blob/389799b5fa0eaa10e6f92d002dc1ee3ea3bc0660/lib/template.js#L21.
As you can see from the comments, when jwalton was trying to debug, the last instrumented file was a sprout.coffee.
There are two possible solutions:
I have used the first approach here https://github.com/abresas/register-coffee-coverage, a module that I use as a replacement for my mocha tests, passing --require register-coffee-coverage.
I would prefer this is fixed from coffee-coverage project itself, so I can throw away my wrapper-module .