Repository navigation
Conversation
Vitest 5.1.1 installs @vitest/istanbul-lib-coverage 2.1.1, which fixes duplicated statements when merging jsdom and browser coverage. Unit and component tests now run as two projects in vitest.config.ts, so one `vitest run` produces the combined report in coverage/vitest and vitest.component.config.ts is no longer needed. - Upgrade vitest and @vitest/* to 5.1.1 - Bump @types/node to ^22 to satisfy vitest's peer range (npm ci) - test:unit / test:component select a project with --project - coverage:merge now merges coverage/vitest + coverage/integration - Update README Final merged coverage is identical to the previous two-config flow (77/81 statements, 14/14 branches, 25/27 functions). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Vitest 5.1.1 installs
@vitest/istanbul-lib-coverage@2.1.1, which fixes statements being counted twice when jsdom and browser coverage are merged (vitest-dev/vitest#12040, vitest-dev/istanbuljs#25). That lets us drop the two-config workaround:vitest.config.tsnow defines two projects:unit(jsdom) andcomponent(Playwright browser). Onevitest runproduces the combined report incoverage/vitest.vitest.component.config.tsis removed.test:unit/test:componentselect a project with--project;lcov:unit/lcov:componentare replaced bylcov:vitest.coverage:mergeis nownextcov merge coverage/vitest coverage/integration -o coverage/merged.@vitest/*upgraded to 5.1.1.@types/nodebumped to^22to satisfy vitest 5.1.1's peer range, sonpm ciworks without--legacy-peer-deps.Verification
Run locally on Windows:
vitest runwith both projectsnextcov mergenextcov mergeA per-file diff of the two final merged reports shows no differences.
npm ci,npm test(13 tests),npm run build:localandnpm run integration-test(4 tests) all pass.Notes
2.1.0. The library bug shows up when merging the separately produced JSON reports with istanbul: 92 statements with 2.1.0, 87 with 2.1.1, versus the correct 81. The remaining duplicate isIcons.tsx, where the browser transform adds a'use client'statement and ends ranges on different lines; the 2.1.1 fix doesn't cover that. nextcov's own merge gives 81 either way.tsc --noEmitreports 3 existing type errors insrc/api/__tests__/api.test.ts(HeadersInit.get). They appear with@types/node20 as well, so this PR doesn't cause them.test:unitortest:componentalone writes only that project's coverage; usenpm testfor the combined report.🤖 Generated with Claude Code