-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Allow instrumentation of transformed files with weird file extensions #9589
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This makes sense to me. Could you add an integration test as well? We have some for coverage already
Okay, I’ve added my example project as an integration test. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, thank you! Just running prettier/eslint on the one file and we should be good to go 🙂
917b8f0
to
b6b8308
Compare
Just to make sure I did the right thing here: I added an exemption to I left the copyright header on |
I honestly have no idea what the header is for, but just adding the header seems easiest. The blacklist is for stuff like vendored modules and config files, I think, but this is code (albeit tests) |
Codecov Report
@@ Coverage Diff @@
## master #9589 +/- ##
==========================================
+ Coverage 65.06% 65.07% +0.01%
==========================================
Files 286 287 +1
Lines 12137 12141 +4
Branches 3007 3008 +1
==========================================
+ Hits 7897 7901 +4
Misses 3605 3605
Partials 635 635
Continue to review full report at Codecov.
|
b6b8308
to
70fd2de
Compare
Eh, I guess I’m willing to claim to be an “affiliate” for this purpose. Updated. |
This comment has been minimized.
This comment has been minimized.
d8714fe
to
80077a9
Compare
Codecov Report
@@ Coverage Diff @@
## master #9589 +/- ##
==========================================
- Coverage 65.06% 65.06% -0.01%
==========================================
Files 286 287 +1
Lines 12137 12141 +4
Branches 3007 3010 +3
==========================================
+ Hits 7897 7899 +2
- Misses 3605 3606 +1
- Partials 635 636 +1
Continue to review full report at Codecov.
|
The default configuration of babel-plugin-istanbul only allows instrumentation of files with extensions .js, .cjs, .mjs, .ts, .tsx, .jsx (https://github.com/istanbuljs/schema/blob/v0.1.2/index.js#L71). However, we know that we’re running it on code that we just transformed to JavaScript, so the source language no longer matters, and we should disable this check to get complete instrumentation. Signed-off-by: Anders Kaseorg <[email protected]>
Signed-off-by: Anders Kaseorg <[email protected]>
80077a9
to
443734c
Compare
This comment has been minimized.
This comment has been minimized.
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
The default configuration of
babel-plugin-istanbul
only allows instrumentation of files with extensions.js
,.cjs
,.mjs
,.ts
,.tsx
,.jsx
(https://github.com/istanbuljs/schema/blob/v0.1.2/index.js#L71). However, we know that we’re running it on code that we just transformed to JavaScript, so the source language no longer matters, and we should disable this check to get complete instrumentation.Test plan
With the example project at https://github.com/andersk/jest-handlebars-test, before:
and after: