这是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

Conversation

namidapoo
Copy link
Contributor

@namidapoo namidapoo commented Jul 16, 2025

Description

Update the test:projects script in the with-vitest example to use Vitest's projects feature directly.

# examples/with-vitest/package.json
- "test:projects": "turbo run test",
+ "test:projects": "vitest run",

Currently, the test:projects script runs turbo run test, which leverages Turborepo's package-level caching. However, given the script name and the example's hybrid approach documentation, it seems more appropriate for this command to use vitest run directly to demonstrate Vitest's projects feature.

Changes made:

  • Updated package.json to use vitest run for the test:projects script
  • Updated README.md to accurately describe what test:projects does
  • Updated the documentation in docs/site/content/docs/guides/tools/vitest.mdx to reflect the correct usage

Testing Instructions

  1. Clone the repository and navigate to the examples/with-vitest directory
  2. Install dependencies: pnpm install
  3. Build the shared config: pnpm --filter @repo/vitest-config build
  4. Run the following commands to verify the fix:
    • pnpm test - Should run tests using Turborepo (with caching)
    • pnpm test:projects - Should run tests using Vitest's projects feature directly
    • pnpm test:projects:watch - Should run tests in watch mode using Vitest's projects feature
  5. Verify that test and test:projects now have different behaviors as intended

@namidapoo namidapoo requested review from anthonyshew and a team as code owners July 16, 2025 04:49
@namidapoo namidapoo requested a review from tknickman July 16, 2025 04:49
@turbo-orchestrator turbo-orchestrator bot added area: docs Improvements or additions to documentation area: examples Improvements or additions to examples needs: triage New issues get this label. Remove it after triage labels Jul 16, 2025
Copy link

vercel bot commented Jul 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-basic-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 17, 2025 2:42am
examples-designsystem-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 17, 2025 2:42am
examples-tailwind-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 17, 2025 2:42am
examples-vite-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 17, 2025 2:42am
turbo-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 17, 2025 2:42am

Copy link

vercel bot commented Jul 16, 2025

@namidapoo is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@anthonyshew anthonyshew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for this. Can you remove the unrelated docs changes (the newline changes and dangling commas)?

The 'test:projects' script was incorrectly using "turbo run test" instead of
"vitest run", which didn't match the intended behavior of using Vitest's
projects feature directly.
@namidapoo namidapoo force-pushed the fix/vitest-scripts branch from b265d34 to 7e043c9 Compare July 16, 2025 13:30
@namidapoo
Copy link
Contributor Author

Hi, thanks for this. Can you remove the unrelated docs changes (the newline changes and dangling commas)?

@anthonyshew Thanks for the feedback!
Those formatting changes (newlines and dangling commas) weren't intentional - they were applied by git hooks.
I've addressed this in 7e043c9

Copy link
Contributor

@anthonyshew anthonyshew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, let's merge!

@anthonyshew anthonyshew enabled auto-merge (squash) July 17, 2025 02:40
@anthonyshew anthonyshew merged commit db8f89a into vercel:main Jul 17, 2025
35 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: docs Improvements or additions to documentation area: examples Improvements or additions to examples needs: triage New issues get this label. Remove it after triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants