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

unable to custom define babel plugins for istanbul-lib-instrument? #8938

Closed
JounQin opened this issue Sep 11, 2019 · 8 comments
Closed

unable to custom define babel plugins for istanbul-lib-instrument? #8938

JounQin opened this issue Sep 11, 2019 · 8 comments

Comments

@JounQin
Copy link

JounQin commented Sep 11, 2019

🚀 Feature Proposal

Support custom babel plugins for istanbul-lib-instrument.

Motivation

istanbuljs/istanbuljs#465 (comment)

Example

Please see above PR.

@SimenB
Copy link
Member

SimenB commented Sep 11, 2019

Please provide more details, such as a (minimal) repository showing what you want to do and how Jest falls short. We only use istanbul-lib-instrument directly here: https://github.com/facebook/jest/blob/736edd2ea6c9aadfb6e8794ecdc8a726f8a76b1a/packages/jest-reporters/src/generateEmptyCoverage.ts#L9

The code goes through the transformer though, so all of your babel config should be picked up. So I don't understand what you're asking for.

@JounQin
Copy link
Author

JounQin commented Sep 11, 2019

@coreyfarrell @JaKXz It's not about transform, it's about coverage collection. My test cases passed, but the coverage collection failed because istanbul-lib-instrument can't recognize the valid syntax.

You can check https://github.com/rx-ts/babel-preset-proposal-typescript, remove the postinstall script first which does a trick for patching istanbul-lib-instrument inside node_modules, and simply run yarn && yarn test. It will throw an error, and I don't know how to prevent it in jest configuration.

istanbuljs/istanbuljs#465 (comment)

@SimenB Please check. Or it would be better to look through the context from original issue.

@SimenB
Copy link
Member

SimenB commented Sep 11, 2019

That's a PR without an opening post and the repo you link to is far from minimal.

https://www.snoyman.com/blog/2017/10/effective-ways-help-from-maintainers

@JounQin
Copy link
Author

JounQin commented Sep 11, 2019

The PR comments should be very clear that I'm trying to test babel plugin v8intrinsic which is first available from v7.6.0, but for now it's not possible to add this additional babel plugin into istanbul-lib-instrument because we don't provide any config option to do this, and it breaks jest coverage collection (The test cases themselves passed).

Whatever, I'll trigger a CI build with error to reproduce it for you.

@JounQin
Copy link
Author

JounQin commented Sep 11, 2019

@github-actions
Copy link

This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the Stale label Feb 25, 2022
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

@github-actions
Copy link

github-actions bot commented May 3, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants