boxtribute icon indicating copy to clipboard operation
boxtribute copied to clipboard

Fix vitest workspace deprecation warning by migrating to projects config

Open Copilot opened this issue 7 months ago • 1 comments

https://trello.com/c/7GkdzEfj/1819-20-fe-fix-vitest-workspace-deprecation-warning-by-migrating-to-projects-config

This PR addresses deprecation warnings in vitest v3 by migrating from the deprecated workspace configuration to the new projects-based setup.

Changes Made

Vitest Configuration Migration:

  • Removed deprecated vitest.workspace.json file
  • Created new root-level vitest.config.ts using the test.projects field
  • Migrated project references: ["front/vite.config.ts", "shared-components/vitest.config.ts"]

Configuration Updates:

  • Updated root tsconfig.json to include the new vitest.config.ts file
  • Modified .eslintrc.cjs to support root-level TypeScript files by adding ./tsconfig.json to the project paths

Issue Resolution

The main deprecation warning was:

DEPRECATED  The workspace file is deprecated and will be removed in the next major. Please, use the `test.projects` field in the root config file instead.

This warning appeared every time pnpm test was run. The new configuration follows vitest v4 best practices and eliminates the deprecation warning.

Verification

  • ✅ All frontend builds pass: pnpm -C front build and pnpm -C statviz build
  • ✅ All tests pass: pnpm test runs without deprecation warnings
  • ✅ ESLint and TypeScript configurations work correctly with the new setup
  • ✅ No vitest-related deprecation warnings are present

The codebase is now ready for vitest v4 and uses the recommended configuration patterns.

Fixes #2258.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot avatar Aug 11 '25 07:08 Copilot

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 75.18%. Comparing base (ceb9308) to head (96c5b72). :warning: Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2298   +/-   ##
=======================================
  Coverage   75.18%   75.18%           
=======================================
  Files         275      275           
  Lines       18958    18958           
  Branches     1773     1773           
=======================================
  Hits        14253    14253           
  Misses       4661     4661           
  Partials       44       44           
Flag Coverage Δ
backend 99.67% <ø> (ø)
frontend 66.32% <ø> (ø)
sharedComponents 66.84% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Aug 11 '25 07:08 codecov[bot]