Skip to content

Commit e7ee1bb

Browse files
authored
Vitest 5 (#3368)
https://vitest.dev/blog/vitest-5.html https://vitest.dev/guide/migration/ Two changes needed: - Switch the date-picker’s partial text assertion to `toMatchTextContent`. `toHaveTextContent` now requires exact text, and the button includes the icon’s “Select” title. - Ignore `.vitest/` and include it in CI artifacts. Automatic failure screenshots now go there instead of following our existing `screenshotDirectory` setting. The promised perf improvements turned out to be pretty small: | Suite | 4.1.11 | 5.0.0, upgrade only | Change | |---|---:|---:|---:| | Node | 1.39s | 1.33s | −4.1% | | Chromium | 4.15s | 4.15s | Unchanged | | Node + all three browsers | 9.13s | 8.61s | −5.6% | Second commit enables [`fsModuleCache`](https://vitest.dev/config/fsmodulecache), as recommended by `vitest doctor`. Warm Node runs drop to **1.09s**, about 22% faster than v4. This mainly helps local test runs.
1 parent 0a4aca0 commit e7ee1bb

6 files changed

Lines changed: 159 additions & 152 deletions

File tree

.github/workflows/lintBuildTest.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,7 @@ jobs:
100100
if: always()
101101
with:
102102
name: test-results-${{ matrix.playwright }}
103-
path: test-results/
103+
path: |
104+
test-results/
105+
.vitest/
104106
retention-days: 7

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ test-results/
3232
ci-e2e-traces/
3333
playwright-report/
3434
.e2e-logs/
35+
.vitest/
3536
.vercel
3637

3738
# Visual regression snapshots

app/components/form/fields/DateTimeRangePicker.browser.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ test.each([
5656
await expect.element(screen.getByText(`Preset: ${preset}`)).toBeVisible()
5757
await expect
5858
.element(screen.getByRole('button', { name: 'Choose a time range preset' }))
59-
.toHaveTextContent(option)
59+
.toMatchTextContent(option)
6060
})
6161

6262
test('chooses a preset with the keyboard', async () => {

0 commit comments

Comments
 (0)