Skip to content

chore(deps): bump vitest + @vitest/coverage-v8 to 5.0.1 (supersedes #9, #4) - #18

Merged
clubanderson merged 2 commits into
mainfrom
deps/vitest-5
Sep 23, 2026
Merged

clubanderson merged 2 commits into
mainfrom
deps/vitest-5

Conversation

@clubanderson

Copy link
Copy Markdown
Member

What

Bumps vitest and @vitest/coverage-v8 to 5.0.1 together, and adds vite as an explicit devDependency.

Supersedes Dependabot PRs #9 and #4.

Why one PR

The two packages are version-locked; merging either alone breaks the test run. Dependabot raised them separately, so neither could pass on its own.

Why vite is now explicit

Vitest 5 no longer re-exports vite, so the bump alone fails type checking:

vitest.config.ts(2,38): error TS2307: Cannot find module 'vite'
vitest.config.ts(13,23): error TS7006: Parameter 'code' implicitly has an 'any' type
vitest.config.ts(13,29): error TS7006: Parameter 'id' implicitly has an 'any' type

vitest.config.ts imports transformWithEsbuild from vite directly, so it should have been a direct dependency all along. Pinned to 8.1.5, the version already resolved in the lockfile, so nothing else moves. The implicit-any errors cascade from the failed import and clear with it.

Vitest 5 requirements

Node 22 and Vite 6.4+. CI runs Node 22 in vitest.yml, and the resolved Vite is 8.1.5. Both floors are met.

🤖 Generated with Claude Code

…it vite

Supersedes the separate Dependabot PRs #9 and #4, which had to land
together: vitest and @vitest/coverage-v8 are version-locked, and merging
either alone breaks the test run.

Vitest 5 no longer re-exports vite, so vitest.config.ts failed to type
check on the bump alone:

  vitest.config.ts(2,38): error TS2307: Cannot find module 'vite'
  vitest.config.ts(13,23): error TS7006: Parameter 'code' implicitly has an 'any' type
  vitest.config.ts(13,29): error TS7006: Parameter 'id' implicitly has an 'any' type

The config imports transformWithEsbuild from vite directly, so vite is
now an explicit devDependency pinned to the version already resolved in
the lockfile (8.1.5). The implicit-any errors cascade from the failed
import and resolve with it.

Vitest 5 requires Node 22 and Vite 6.4+. CI runs Node 22 (vitest.yml)
and the resolved Vite is 8.1.5, so both floors are met.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@netlify

netlify Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for hivecommons-docs ready!

Name Link
🔨 Latest commit aee9a04
🔍 Latest deploy log https://app.netlify.com/projects/hivecommons-docs/deploys/6ab419ff35ca0800084a004d
😎 Deploy Preview https://deploy-preview-18--hivecommons-docs.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.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the supersession claim and the diff against the tree; one real failure remains before this can land.

Supersession is genuine. #4 bumps only @vitest/coverage-v8 and #9 bumps only vitest; the two packages are peer-locked (coverage-v8 5.0.1 peer-requires vitest: 5.0.1), so neither can pass alone — I've flagged both for closure in favour of this PR. The explicit vite: ^8.1.5 devDependency is also correct: vitest.config.ts:2 imports transformWithEsbuild from 'vite', and vitest 5 no longer re-exports it, so it should have been a direct dependency all along. Pinning to the already-resolved 8.1.5 keeps the rest of the lockfile still.

Remaining defect: src/__tests__/Mermaid.test.tsx fails under vitest 5 (CI job 107317954371: 444 passed, 1 failed). The failing assertion (Mermaid.test.tsx:33-38) checks that mermaid.initialize was called at module load — the call happens as a top-level side effect in src/lib/Mermaid.tsx:6. Under vitest 4 the vi.mock('mermaid', …) factory's vi.fn() retained that call record by the time the test ran; under 5.0.1 it no longer does (the mock's call history is empty when asserted). The component behaviour is unchanged — this is a test-harness interaction with vitest 5's mock/module lifecycle, and the fix belongs in this PR since it's what makes the suite red. One option: re-import @/lib/Mermaid inside the test after vi.resetModules() so the side effect runs within the test's scope, rather than relying on cross-test module-load ordering.

Everything else checked out: TypeScript & ESLint pass on this head, and the Node 22 / Vite 6.4+ floors claimed in the body match vitest.yml and the resolved lockfile.

— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88

Vitest 5 changed module evaluation ordering, so the static
`import { MermaidComponent }` at the top of the file is no longer
guaranteed to have been evaluated when the assertion runs. The side
effect under test (`mermaid.initialize`) fires at the top level of
@/lib/Mermaid, so import it explicitly inside the test instead of
depending on that ordering.

444 of 445 tests already passed on vitest 5; this was the only one
relying on the old behaviour.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@clubanderson
clubanderson merged commit 58349c0 into main Sep 23, 2026
8 of 9 checks passed
@clubanderson
clubanderson deleted the deps/vitest-5 branch September 23, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant