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鈥檒l 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

Open
JounQin opened this issue Sep 11, 2019 · 5 comments
Open

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

JounQin opened this issue Sep 11, 2019 · 5 comments

Comments

@JounQin
Copy link

@JounQin 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

This comment has been minimized.

Copy link
Collaborator

@SimenB 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:

import {readInitialCoverage} from 'istanbul-lib-instrument';

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

This comment has been minimized.

Copy link
Author

@JounQin 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

This comment has been minimized.

Copy link
Collaborator

@SimenB 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

This comment has been minimized.

Copy link
Author

@JounQin 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

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can鈥檛 perform that action at this time.