Open Dakuan opened 8 years ago
That's because they both duck-punch module.extensions
to implement their magic when files are loaded via require
. About the only real solution is to save your instrumented files and run your tests against those. It's not awesome.
nyc
provides istanbul based coverage reports, and uses append-transform
to wrap require extensions in a way that is compatible with proxyquire
and almost any other correctly executed require extension.
I found myself having the same problem, instead of using nyc I used c8 and configured it. The c8's README is clear and it worked like a charm.
This issue still persists. Is there any update on this?
Having some bother getting istanbul and proxyquire to play nicely.
If I import a module into my test normally:
Then istanbul covers the module as expected.
Importing with proxyquire works, in that I can stub the things, but istanbul says that file is no longer covered, when it definitely is.