You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Observing problems using testdouble and nyc in the same project.
Issue
I have a small es6 Javascript project that uses testdouble with a mocha test runner. mocha works fine, but nyc mocha is flakey.
When coverage fails, I see transformation error messages in the console output and the coverage report is empty. If I comment-out the td code in my tests and re-run test coverage, then coverage works and will continue to work until I change the code-under-test, at which point the instrumentation fails again.
I couldn't find any projects where testdouble was used with code coverage, so I converted my project to use rewiremock and coverage worked reliably.
Environment
node -v output: v8.9.4
npm -v output: 6.1.0
npm ls testdouble version: 3.8.1
Example Repo
This project might be useful in repro'ing the issue:
Could you provide a reproduction that uses testdouble? I've definitely seen tdjs used in projects with coverage before, so I'm dubious that this is a testdouble.js issue.
For example, the library itself uses nyc for coverage and it makes ample use of td.replace in the unit test suite, but still shows accurate coverage readings AFAICT:
Description
Observing problems using testdouble and nyc in the same project.
Issue
I have a small es6 Javascript project that uses testdouble with a mocha test runner.
mocha
works fine, butnyc mocha
is flakey.When coverage fails, I see transformation error messages in the console output and the coverage report is empty. If I comment-out the
td
code in my tests and re-run test coverage, then coverage works and will continue to work until I change the code-under-test, at which point the instrumentation fails again.I couldn't find any projects where testdouble was used with code coverage, so I converted my project to use
rewiremock
and coverage worked reliably.Environment
node -v
output: v8.9.4npm -v
output: 6.1.0npm ls testdouble
version: 3.8.1Example Repo
This project might be useful in repro'ing the issue:
https://github.com/jamestalmage/__demo-nyc-with-proxyquire
The text was updated successfully, but these errors were encountered: