Skip to content

chore: Update vitest to v4#116

Merged
raphaelcoeffic merged 1 commit intoEdgeTX:mainfrom
rickard-von-essen:vitest-3
Mar 2, 2026
Merged

chore: Update vitest to v4#116
raphaelcoeffic merged 1 commit intoEdgeTX:mainfrom
rickard-von-essen:vitest-3

Conversation

@rickard-von-essen
Copy link
Contributor

@rickard-von-essen rickard-von-essen commented May 24, 2025

Summary

  • Update vitest and companion packages to v4 (vitest, @vitest/coverage-v8, @vitest/ui, @vitest/web-worker)
  • Update @vitejs/plugin-react to ^4.5.0 and vite-tsconfig-paths to ^5.1.4
  • Remove deprecated coverage.all config option (replaced by coverage.include in v4)

Coverage note

Codecov reports a ~10% drop in overall coverage. This is not a regression in test quality — vitest 4 uses AST-based branch detection which is significantly more thorough than the old v8-to-istanbul approach. It counts many more branches (e.g. optional chaining, ternaries, default parameters) that were previously invisible. Statement/line coverage is largely unchanged.

Test plan

  • All 128 tests pass locally and in CI
  • CI passes (lint, format, test, test-types, storybook, compile)

🤖 Generated with Claude Code

@codecov
Copy link

codecov bot commented May 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 34.39%. Comparing base (74dd5e1) to head (6567a5a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #116       +/-   ##
===========================================
- Coverage   44.52%   34.39%   -10.14%     
===========================================
  Files         108      102        -6     
  Lines       13268     3175    -10093     
  Branches      630      776      +146     
===========================================
- Hits         5908     1092     -4816     
+ Misses       7350     1935     -5415     
- Partials       10      148      +138     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@raphaelcoeffic
Copy link
Member

raphaelcoeffic commented May 29, 2025

@rickard-von-essen it seems the code coverage for web worker breaks with vitest v3. Can you please have a look?

You can see that this PR changes the code coverage numbers, whereby it shouldn't actually. What happens here is that the web worker is excluded from the total, thus increasing the ratio tested/untested.

@rickard-von-essen
Copy link
Contributor Author

Didn't notice that. I'll have a look in few days.

@rickard-von-essen
Copy link
Contributor Author

Failed to convert coverage for file:///Users/ext.rickard.von/src/edgetx-buddy/src/webworker/backend.worker.ts.
 TypeError: Cannot read properties of undefined (reading 'endCol')
    at range.sliceRange (file:///Users/ext.rickard.von/src/edgetx-buddy/node_modules/@vitest/coverage-v8/dist/provider.js:554:55)
    at CovSource.offsetToOriginalRelative (file:///Users/ext.rickard.von/src/edgetx-buddy/node_modules/@vitest/coverage-v8/dist/provider.js:1985:20)
    at V8ToIstanbul._maybeRemapStartColEndCol (file:///Users/ext.rickard.von/src/edgetx-buddy/node_modules/@vitest/coverage-v8/dist/provider.js:2394:93)
    at file:///Users/ext.rickard.von/src/edgetx-buddy/node_modules/@vitest/coverage-v8/dist/provider.js:2303:61
    at Array.forEach (<anonymous>)
    at file:///Users/ext.rickard.von/src/edgetx-buddy/node_modules/@vitest/coverage-v8/dist/provider.js:2301:21
    at Array.forEach (<anonymous>)
    at V8ToIstanbul.applyCoverage (file:///Users/ext.rickard.von/src/edgetx-buddy/node_modules/@vitest/coverage-v8/dist/provider.js:2300:13)
    at file:///Users/ext.rickard.von/src/edgetx-buddy/node_modules/@vitest/coverage-v8/dist/provider.js:2762:16
    at async Promise.all (index 9)

@raphaelcoeffic raphaelcoeffic force-pushed the vitest-3 branch 4 times, most recently from 185ee3e to 90475e0 Compare March 2, 2026 05:08
Update vitest and companion packages (@vitest/coverage-v8,
@vitest/ui, @vitest/web-worker, vite-tsconfig-paths,
@vitejs/plugin-react) to v4.

Remove deprecated coverage.all option (replaced by coverage.include
in v4).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@raphaelcoeffic raphaelcoeffic changed the title chore: Update vitest to v3 chore: Update vitest to v4 Mar 2, 2026
@raphaelcoeffic raphaelcoeffic merged commit f4bd590 into EdgeTX:main Mar 2, 2026
16 of 17 checks passed
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.

2 participants