Skip to content

build(deps-dev): bump vitest family to 5.0.5 - #140

Merged
jvcorredor merged 2 commits into
mainfrom
cscs.dev-117-vitest-5
Nov 3, 2026
Merged

jvcorredor merged 2 commits into
mainfrom
cscs.dev-117-vitest-5

Conversation

@jvcorredor

@jvcorredor jvcorredor commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Supersedes #111, #102 and #133 (left open for you to close).

Summary

 devDependencies
-  vitest                    ^4.1.1
-  @vitest/browser-playwright ^4.0.14
-  @vitest/coverage-v8        ^4.1.1
+  vitest                    ^5.0.5   (locked 5.0.5)
+  @vitest/browser-playwright ^5.0.5  (locked 5.0.5)
+  @vitest/coverage-v8        ^5.0.5  (locked 5.0.5)
 src/test/
+└── vitest-matchers.d.ts    # types only: restores jest-dom's toHaveTextContent(RegExp)
  • Why each Dependabot PR failed alone: @vitest/browser-playwright and @vitest/coverage-v8 peer-pin the exact same vitest version, so bumping one gives npm ci an ERESOLVE. They have to move together.
  • Vitest 5 ships browser-mode DOM matcher types (via vitest/config in vitest.config.ts) where toHaveTextContent(text?: string | number) rejects RegExp. They shadow @testing-library/jest-dom, so astro check failed on 5 existing assertions. The jsdom tests still run jest-dom's matcher at runtime. No test was changed: src/test/vitest-matchers.d.ts re-declares jest-dom's signature on Matchers (the Assertion type parameter lists disagree across libs). Drop it if tests move to Vitest browser mode, where toMatchTextContent replaces the RegExp form.
  • Pinned to 5.0.5, published 2026-10-15 (past the 7-day cooldown). 5.1.0 was published 2026-11-02, so the lock does not take it; transitive tinybench is pinned to 6.2.2 (6.2.3 is inside the cooldown), and every package the lock changes vs main is >= 7 days old.
  • vitest 5 pulls in @vitest/ui (needed by the test:ui script anyway) and the lock dedupes some transitive packages.

Evidence

Merge Danger

Door: two-way

Revert the commit to return to 4.1.12.

Blast Radius: dev tooling

Test, coverage and storybook tooling only. No runtime or production code changes.

Refs: #117

🤖 Generated with Claude Code

@netlify

netlify Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cscsdev ready!

Name Link
🔨 Latest commit 9066a17
🔍 Latest deploy log https://app.netlify.com/projects/cscsdev/deploys/6ae9e3c229898459699aadd9
😎 Deploy Preview https://deploy-preview-140--cscsdev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jvcorredor

Copy link
Copy Markdown
Contributor Author

Review verdicts

One combined cold reviewer (correctness, tests and supply chain). In a fresh clone, the full gate passes and coverage is identical to main. Deliberately wrong matcher calls still fail typecheck.

# Finding Severity Verdict
1 The lock pins transitive tinybench 6.2.3 (published 2026-11-01). That breaks the 7-day cooldown the PR body claims, and 6.2.2 satisfies the range. minor fix: resolve tinybench to 6.2.2 in the lockfile, with no overrides entry. Then re-check that every changed package is at least 7 days old.
2 The src/test/vitest-matchers.d.ts type parameters differ from the @vitest/expect and jest-dom declarations, so tsc --skipLibCheck false reports TS2428. minor fix: match the type parameter list exactly so the interface merges cleanly. Verify with npx tsc --noEmit --skipLibCheck false -p ., scoped to the new file's diagnostics, and keep astro check at 0 errors.
3 The declaration is global nit reject: it matches jest-dom's own global augmentation
4 fflate has no npm provenance nit reject: it is an existing upstream transitive dependency we don't control, and it has no install scripts
5 The Co-Authored-By trailer names Opus 5.5 nit reject: that is the required attribution

@jvcorredor
jvcorredor force-pushed the cscs.dev-117-vitest-5 branch from cd21268 to 1d5305f Compare November 3, 2026 13:25
@jvcorredor

Copy link
Copy Markdown
Contributor Author

Fix round verified by an independent verifier at 1d5305f. Both fix verdicts are confirmed:

  1. tinybench is at 6.2.2. Every changed lock entry has an integrity hash that matches the registry, and all of them were published at least 7 days ago.
  2. The Matchers augmentation has no diagnostics under --skipLibCheck false. Mutants confirmed the shim is still needed, and wrong calls still fail typecheck.

I am taking the Matchers route over the suggested tsconfig exclude of vitest.config.ts, because the exclude would drop typechecking of that file. This PR merges after the four Dependabot PRs ahead of it, once it has been rebased onto main.

jvcorredor and others added 2 commits November 3, 2026 07:36
Bump vitest, @vitest/browser-playwright and @vitest/coverage-v8 from
4.1.12 to 5.0.5 together. Each Dependabot PR (#111, #102, #133) fails
alone at `npm ci` because the packages peer-pin each other to the exact
same vitest version.

Vitest 5 ships browser-mode DOM matcher types in which toHaveTextContent
no longer accepts a RegExp. They shadow @testing-library/jest-dom's
signature and broke `astro check` on five existing assertions, although
the jsdom tests still run jest-dom's matcher. Re-declare jest-dom's
signature in src/test/vitest-matchers.d.ts instead of changing tests.

5.0.5 was published 2026-10-15, past the 7-day cooldown; 5.1.0
(2026-11-02) is not.

Supersedes #111, #102 and #133.

Refs: #117

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve the transitive tinybench to 6.2.2 in the lockfile; 6.2.3 was
published 2026-11-01, inside the 7-day release cooldown. Every package
the lock changes against main is now at least 7 days old.

Augment Vitest's Matchers interface with the exact type parameter list
it is declared with instead of Assertion. jest-dom, @vitest/browser and
Vitest declare Assertion with three different parameter lists, so any
further declaration of it reports TS2428 under --skipLibCheck false.

Refs: #117

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant