chore(deps-dev): bump vitest from 3.2.4 to 4.1.0#816
Conversation
Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 3.2.4 to 4.1.0. - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Changelog](https://github.com/vitest-dev/vitest/blob/main/docs/releases.md) - [Commits](https://github.com/vitest-dev/vitest/commits/v4.1.0/packages/vitest) --- updated-dependencies: - dependency-name: vitest dependency-version: 4.1.0 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| "typedoc": "^0.28.9", | ||
| "typescript": "^5.3.0", | ||
| "vitest": "^3.2.4", | ||
| "vitest": "^4.1.0", |
There was a problem hiding this comment.
🔴 Vitest 4 removed the workspace config feature (defineWorkspace and auto-detection of vitest.workspace.{ts,js,json}), so after this bump vitest.workspace.ts is ignored/broken and the test:integration and test:e2e scripts (which run vitest run --project=integration / --project=e2e) will fail with "No projects matched the filter" because vitest.config.ts has no projects: field. To fix, migrate the two project entries from vitest.workspace.ts into a projects: [...] array inside vitest.config.ts and delete vitest.workspace.ts.
Extended reasoning...
What the bug is
Vitest 4 removed the workspace config feature. Per the Vitest 4 migration guide, defineWorkspace is no longer exported from vitest/config, and vitest.workspace.{ts,js,json} files are no longer auto-detected. Projects must instead be defined via the projects config option in vitest.config.ts.
This repo still has vitest.workspace.ts (lines 1–77) which imports { defineWorkspace } from "vitest/config" and defines two projects, integration and e2e. Meanwhile vitest.config.ts has no projects field — it is a single flat test config.
How it manifests
The package.json scripts at the heart of integration and e2e testing invoke project filters:
"test:integration": "pnpm run build && vitest run --project=integration",
"test:integration:watch": "pnpm run build && vitest --project=integration",
"test:e2e": "pnpm run build && vitest run --project=e2e"After this PR is merged, both scripts fail with Error: No projects matched the filter "integration" (and the same for e2e), because Vitest 4 doesn't load the workspace file at all and no projects are configured in vitest.config.ts.
Why existing code doesn't prevent it
The workspace file is silently dropped by Vitest 4 — there is no startup error nudging the user toward the new API. The verifier reproduced this empirically: ./node_modules/.bin/vitest run --project=integration errors with No projects matched the filter "integration". Inspection of vitest@4.1.0's dist/config.d.ts and dist/config.js confirms that only defineConfig and defineProject are exported — defineWorkspace is gone.
Step-by-step proof
- Install this PR:
pnpm installbrings invitest@4.1.0. - Run
pnpm run test:integration. The build step succeeds, thenvitest run --project=integrationis invoked. - Vitest 4 reads
vitest.config.ts— it contains noprojectsarray. - Vitest 4 does NOT scan for
vitest.workspace.ts(this auto-detection was removed). - The
--project=integrationfilter has nothing to match → Vitest exits withError: No projects matched the filter "integration". - Same path for
pnpm run test:e2e.
Impact
Two production scripts (test:integration, test:e2e) plus the corresponding watch script are broken. Any CI job or developer workflow that exercises the integration or e2e suites after this dependency bump will fail at the vitest invocation. The workspace file becomes dead code at best; at worst, if anything tries to import it directly, it throws because defineWorkspace is undefined.
How to fix
Migrate the two entries from vitest.workspace.ts into a projects: [...] array inside the test block of vitest.config.ts, then delete vitest.workspace.ts. Roughly:
// vitest.config.ts
export default defineConfig({
test: {
// existing root config...
projects: [
{
test: { name: "integration", environment: "node", include: [...], setupFiles: [...] },
resolve: { alias: { /* ... */ } },
},
{
test: { name: "e2e", environment: "node", include: [...], setupFiles: [...], testTimeout: 30000 },
resolve: { alias: { /* ... */ } },
},
],
},
});|
Superseded by #819. |
Bumps vitest from 3.2.4 to 4.1.0.
Release notes
Sourced from vitest's releases.
... (truncated)
Commits
4150b91chore: release v4.1.01de0aa2fix: correctly identify concurrent test during static analysis (#9846)c3cac1cfix: use isAgent check, not just TTY, for watch mode (#9841)eab68bachore(deps): update all non-major dependencies (#9824)031f02afix: allow catch/finally for async assertion (#9827)3e9e096feat(reporters): addagentreporter to reduce ai agent token usage (#9779)0c2c013chore: release v4.1.0-beta.68181e06fix:hideSkippedTestsshould not hidetest.todo(fix #9562) (#9781)a8216b0fix: manual and redirect mock shouldn'tloadortransformoriginal module...689a22afix(browser): types ofgetCDPSessionandcdp()(#9716)Maintainer changes
This version was pushed to npm by GitHub Actions, a new releaser for vitest since your current version.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)You can disable automated security fix PRs for this repo from the Security Alerts page.