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

fix: support ESM when reading coverage #692

Merged
merged 3 commits into from
Oct 4, 2023

Conversation

NotWearingPants
Copy link
Contributor

@NotWearingPants NotWearingPants commented Aug 27, 2022

Fixes #614

read-coverage.js attempts to parse the code into AST using Babel, and wants to Parse as leniently as possible according to the comment.
Changing the sourceType from script to unambiguous allows it to handle ESM code as well as regular scripts.

@SimenB SimenB requested a review from bcoe September 9, 2023 10:13
Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems very reasonable to me

@SimenB SimenB removed the request for review from bcoe October 4, 2023 07:23
@SimenB SimenB merged commit fc509cc into istanbuljs:master Oct 4, 2023
5 checks passed
@github-actions github-actions bot mentioned this pull request Oct 4, 2023
@SimenB
Copy link
Member

SimenB commented Oct 4, 2023

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

Successfully merging this pull request may close these issues.

Hardcoded Babel config prevents code coverage for ESM TypeScript modules
2 participants