fix: dedupe generated browser tests to avoid doubled in-flight counters#594
Open
yann-copilot wants to merge 1 commit into
Open
fix: dedupe generated browser tests to avoid doubled in-flight counters#594yann-copilot wants to merge 1 commit into
yann-copilot wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## next #594 +/- ##
===========================================
- Coverage 93.19% 24.80% -68.40%
===========================================
Files 15 41 +26
Lines 294 2818 +2524
Branches 78 159 +81
===========================================
+ Hits 274 699 +425
- Misses 20 2100 +2080
- Partials 0 19 +19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #276
Summary
When browser tests are expanded in
PlaywrightRunner#getTests, duplicate generated entries can inflate in-flight test counters in Jest output (e.g. showing ~2x tests while running, then settling at the expected total at the end).This patch dedupes generated browser tests before execution using a stable key:
Why this helps
The in-flight counter is based on the expanded test list. If that list contains duplicates, users see misleading progress totals.
By deduping before
super.runTests(...), progress reporting remains stable and matches final totals.Changes
src/jest-playwright-preset/PlaywrightRunner.tsdedupeBrowserTestshelperpwTestslistsrc/jest-playwright-preset/PlaywrightRunner.test.tsValidation
corepack yarn test src/jest-playwright-preset/PlaywrightRunner.test.ts