From 9b27ff72606938079f53a001f08eb5dbfaf7c416 Mon Sep 17 00:00:00 2001 From: Connor Date: Tue, 15 Oct 2024 12:55:56 -0500 Subject: [PATCH] failed tests only show with failed option on --- __tests__/__outputs__/jest-test-results.md | 17 --------------- .../__outputs__/playwright-output-failed.md | 21 ------------------- src/report/get-report.ts | 3 +++ 3 files changed, 3 insertions(+), 38 deletions(-) diff --git a/__tests__/__outputs__/jest-test-results.md b/__tests__/__outputs__/jest-test-results.md index bc86f3c..d9161a2 100644 --- a/__tests__/__outputs__/jest-test-results.md +++ b/__tests__/__outputs__/jest-test-results.md @@ -405,28 +405,11 @@ |packages/pretty-format/src/__tests__/ReactElement.test.ts|3✅|||64ms| ### ❌ e2e/__tests__/jestChangedFiles.test.ts ``` -✅ gets hg SCM roots and dedupes them -✅ gets git SCM roots and dedupes them -✅ gets mixed git and hg SCM roots and dedupes them -✅ gets changed files for git -✅ monitors only root paths for git -✅ does not find changes in files with no diff, for git -✅ handles a bad revision for "changedSince", for git ❌ gets changed files for hg Error: abort: empty revision range -✅ monitors only root paths for hg -✅ handles a bad revision for "changedSince", for hg ``` ### ❌ e2e/__tests__/onlyChanged.test.ts ``` -✅ run for "onlyChanged" and "changedSince" -✅ run only changed files -✅ report test coverage for only changed files -✅ report test coverage of source on test file change under only changed files -✅ do not pickup non-tested files when reporting coverage on only changed files -✅ collect test coverage when using onlyChanged -✅ onlyChanged in config is overwritten by --all or testPathPattern ❌ gets changed files for hg Error: expect(received).toMatch(expected) -✅ path on Windows is case-insensitive ``` \ No newline at end of file diff --git a/__tests__/__outputs__/playwright-output-failed.md b/__tests__/__outputs__/playwright-output-failed.md index 74b5148..048e334 100644 --- a/__tests__/__outputs__/playwright-output-failed.md +++ b/__tests__/__outputs__/playwright-output-failed.md @@ -6,33 +6,12 @@ |[tests/grid.spec.ts](#r0s0)|18✅|4❌|3⚪|116s| ### ❌ tests/grid.spec.ts ``` -✅ Grid › Mobile Web › Athlete › should not be able to edit data -✅ Grid › Mobile Web › Admin or Coach › should be able to edit data -✅ Grid › Field Sets › should update displayed grid columns after editing -⚪ Grid › Field Sets › should update displayed clip preview fields after editing -✅ Grid › Basketball Navigation Module › should display correct moment data when filtered by Scout team Points -✅ Grid › Basketball Navigation Module › should display correct moment data when filtered by Opponent Rebounds -✅ Grid › Basketball Navigation Module › should display correct moment data when filtered by Steals -✅ Grid › Basketball Navigation Module › should display correct moment data when filtered by Rebounds -✅ Grid › Basketball Navigation Module › should display clips for opportunities in Period when filtered by Period -✅ Grid › Basketball Navigation Module › should display clips for opportunities that end in a turnover when filtered by Turnovers -✅ Grid › Basketball Navigation Module › should display correct moment data when filtered by 3FG Attempts ❌ Grid › Column Sorting › AmFb Column Sets › should display correct data when sorting by OFF FORM column [chrome] › tests/grid.spec.ts:202:11 › Grid › Column Sorting › AmFb Column Sets › should display correct data when sorting by OFF FORM column › Sort grid by OFF FORM in ascending order -⚪ Grid › Column Sorting › Wrestling Column Sets › should display correct data when sorting by Period column -⚪ Grid › Quick Editor › should be able to edit data from quick editor as an admin or coach ❌ Grid › Data Entry › should open select dropdown options when pressing Spacebar in grid cell [chrome] › tests/grid.spec.ts:254:9 › Grid › Data Entry › should open select dropdown options when pressing Spacebar in grid cell › double click into column OFF FORM clip number 3 ❌ Grid › Data Entry › should be able to use keyboard to navigate horizontal grid and enter data [chrome] › tests/grid.spec.ts:261:9 › Grid › Data Entry › should be able to use keyboard to navigate horizontal grid and enter data › double click into column OFF FORM clip number 3 ❌ Grid › Data Entry › should be able to use keyboard to navigate vertical grid and enter data [chrome] › tests/grid.spec.ts:277:9 › Grid › Data Entry › should be able to use keyboard to navigate vertical grid and enter data › Select BUNCH from column OFF FORM list -✅ Grid › Data Entry › should display error state for input with invalid data -✅ Grid › Data Entry › confirm auto-fill works correctly -✅ Grid › Tagged data › Wrestling › should display correct wrestler names tagged from Assist -✅ Grid › Tagged data › Wrestling › should display correct score and points tagged from Assist -✅ Grid › Tagged data › Wrestling › should display correct Period tagged from Assist -✅ Grid › Tagged data › Wrestling › should display correct Key Moments tagged from Assist -✅ Grid › Tagged data › Wrestling › should edit cells using the team roster -✅ Grid › Tagged data › Wrestling › should change key moment type and update grid data ``` \ No newline at end of file diff --git a/src/report/get-report.ts b/src/report/get-report.ts index 0d82b1a..435bf40 100644 --- a/src/report/get-report.ts +++ b/src/report/get-report.ts @@ -233,6 +233,9 @@ function getTestsReport(ts: TestSuiteResult, runIndex: number, suiteIndex: numbe } const space = grp.name ? ' ' : '' for (const tc of grp.tests) { + if (options.listTests === 'failed' && tc.result !== 'failed') { + continue + } if (options.listTests === 'non-skipped' && tc.result === 'skipped') { continue }