-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
feat: exclude lines that are missing from source maps #244
base: master
Are you sure you want to change the base?
Conversation
Any thoughts about this approach @SimenB and @bcoe? In Vitest we will always have source maps available so we can utilize those for analysing the source file. I believe Jest has them too? I'm not that sure about When source maps are not passed, the empty lines should be marked as covered as before. |
0cff4f5
to
7396cc5
Compare
7396cc5
to
fe075af
Compare
fe075af
to
e3c4935
Compare
Possible to get this merged? We're currently forking this commit so we can get proper coverage numbers in our repo. Def not ideal. |
@joshuanathanson - just curious, what test runner and coverage tool are you using this commit with? |
We have our own wrappers, but under the hood we're using Selenium to run the tests, along with grabbing the coverage from Chrome on the fly with Selenium CDP DevTools. |
This is one of those I'd love to hear @bcoe's thoughts 👀 |
I think this would also fix the related issue in |
feat: exclude lines that are missing from source maps
@jridgewell/trace-mapping
to figure out which lines contain runtime code. If a line is not present in source maps, consider it as empty line. This will exclude Typescript typings, comments, empty lines and any other special syntax that transpiled languages exclude from source maps.Should this be considered as breaking change or be a configurable option?excludeEmptyLines
argument. No breaking changes.Examples:
Vitest
Jest
Playwright
c8, test code transpiled with tsc. It seems to leave comments in source maps - esbuild doesn't.
fix: ignore hint to exclude lines
/* v8 ignore ... */
should exclude the lines from coverage, not mark them as covered.