-
-
Notifications
You must be signed in to change notification settings - Fork 297
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(test-runner): fix error when function metadata varies between tests #1436
Conversation
Collect and merge function definitions from all runs in coverage mapping Fixes modernweb-dev#689 See also istanbuljs/v8-to-istanbul#121
🦋 Changeset detectedLatest commit: 5411d7e The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Let me know what changeset I should add. Maybe a minor bump? |
@Stuk Thanks a lot! We can do a patch, you can run @benjamind @Westbrook could you check if this fixes it for you as well? |
Looking! |
Confirmed this fixes the reproducible test case found here |
@LarsDenBakker actually, I don't want to mess anything up, so would you ind adding the changeset? |
Co-authored-by: Westbrook Johnson <[email protected]>
Added changeset with some help from Westbrook. Thanks! |
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.
I think this is good to go! It's already a big win for my usage in Spectrum Web Components as outlined in the screenshots above and I know a number of other have bumped into this as well. Thanks for digging into this for us @Stuk 🎉
Thanks, much appreciated! |
Fixes #689
See also istanbuljs/v8-to-istanbul#121
What I did
addingMissingCoverageItems
to also add missing functions. This can occur when a function is defined in another function, and the outer function is not called in every test run. For example methods defined on a class using arrow functions=>
are only created when the constructor runs. Specifically, I have moved the code inside the loops out into their own functions, so they can be called with the branch coverage data and the function coverage data.