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

Feature Request: Improved detection of 'already instrumented' files #324

Open
coreyfarrell opened this issue Mar 6, 2019 · 2 comments
Open

Comments

@coreyfarrell
Copy link
Member

Per @jdalton request on #73.

One possible mitigation might be to have the instrumenter insert an /* istanbul ignore file */ comment.

@jdalton
Copy link

jdalton commented Mar 6, 2019

You might also be able to use a custom pragma:

"use istanbul";

These are easy to sniff for, don't interfere with other pragmas (like "use strict"), and won't be removed as easily as comments.

@coreyfarrell
Copy link
Member Author

@jdalton could you point me to an example of where this is a problem? istanbul should already detect that files are already instrumented.. the only exception is if you have multiple major versions of istanbul-lib-instrument for example if 2.x instruments first then 3.x won't detect the existing coverage.

If you are getting the error Cannot read property 'fileCoverage' of undefined then I think this should get fixed by #470.

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