这是indexloc提供的服务,不要输入任何密码
Skip to content

fix(examples): correct 'test:projects' script to use vitest directly #10683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/site/content/docs/guides/tools/vitest.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,10 @@ While your root `package.json` includes scripts for running tests globally:
```json title="./package.json"
{
"scripts": {
"test:projects": "turbo run test",
"test:projects": "vitest run",
"test:projects:watch": "vitest --watch"
}
}
```

This configuration allows developers to run `pnpm test:projects:watch` at the root for a seamless local development experience using Vitest projects, while CI continues to use `turbo run test` to leverage package-level caching. **You'll still need to handle merged coverage reports manually as described in the previous section**.
This configuration allows developers to run `pnpm test:projects` or `pnpm test:projects:watch` at the root for a seamless local development experience using Vitest projects, while CI continues to use `turbo run test` to leverage package-level caching. **You'll still need to handle merged coverage reports manually as described in the previous section**.
2 changes: 1 addition & 1 deletion examples/with-vitest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pnpm build --filter=@repo/vitest-config
## Available Commands

- `pnpm test`: Runs tests in each package using Turborepo (leverages caching)
- `pnpm test:projects`: Same as above, explicitly named for the package-level approach
- `pnpm test:projects`: Runs tests using Vitest's projects feature
- `pnpm test:projects:watch`: Runs tests using Vitest's projects feature in watch mode
- `pnpm view-report`: Collects coverage from each package and shows it in a merged report

Expand Down
2 changes: 1 addition & 1 deletion examples/with-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"scripts": {
"test": "turbo run test",
"test:projects": "turbo run test",
"test:projects": "vitest run",
"test:projects:watch": "vitest --watch",
"view-report": "turbo run view-report"
},
Expand Down
Loading