Skip to content

fix(config): browser setup in defineVitestProject#1724

Merged
danielroe merged 5 commits into
nuxt:mainfrom
yamachi4416:fix-vitest-projects-browser-mode
Jul 17, 2026
Merged

fix(config): browser setup in defineVitestProject#1724
danielroe merged 5 commits into
nuxt:mainfrom
yamachi4416:fix-vitest-projects-browser-mode

Conversation

@yamachi4416

@yamachi4416 yamachi4416 commented Jun 16, 2026

Copy link
Copy Markdown
Member

🔗 Linked issue

📚 Description

Fixed an issue where the browser mode setup was not executed if the environment was not specified as 'nuxt' in defineVitestProject

@socket-security

socket-security Bot commented Jun 16, 2026

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm env-runner is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: pnpm-lock.yamlnpm/nitro@3.0.260311-betanpm/nuxt-nightly@5.0.0-29736940.cd1355ednpm/env-runner@0.1.16

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/env-runner@0.1.16. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm seroval is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: pnpm-lock.yamlnpm/nuxt@4.4.8npm/nuxt-nightly@5.0.0-29736940.cd1355ednpm/seroval@1.5.5

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/seroval@1.5.5. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@pkg-pr-new

pkg-pr-new Bot commented Jun 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/test-utils@1724
npm i https://pkg.pr.new/vitest-environment-nuxt@1724

commit: 7cc4489

@yamachi4416
yamachi4416 force-pushed the fix-vitest-projects-browser-mode branch from 1bbac88 to 4b90de9 Compare June 16, 2026 15:18
@yamachi4416
yamachi4416 marked this pull request as ready for review June 16, 2026 15:31
@yamachi4416
yamachi4416 requested a review from danielroe as a code owner June 16, 2026 15:31
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f86f3555-3c75-43c5-bfca-fbf9fadcb1a1

📥 Commits

Reviewing files that changed from the base of the PR and between c6e40af and 4bc0e73.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • src/config.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/config.ts

📝 Walkthrough

Walkthrough

defineVitestProject now pre-merges the Nuxt test environment before resolving configuration. The app-vitest-workspace example adds Chromium browser testing configuration, browser tests for useAppConfig() and NuxtLink, and the required Vitest browser dependencies.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and matches the main config/browser setup fix in defineVitestProject.
Description check ✅ Passed The description matches the change by explaining the browser setup issue when the environment wasn't set to nuxt.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/app-vitest-workspace/app1/test/app.browser.spec.ts`:
- Around line 7-9: The assertion in the useAppConfig test block is checking for
exact key equality with toEqual(['nuxt']), which is brittle because it will fail
if any additional unrelated config keys are added. Instead of checking for exact
equality of all keys, change the expectation to use toContain('nuxt') to assert
only that the 'nuxt' key is present in the returned config object, making the
smoke test more resilient to future config additions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 35d3e297-b4dd-4497-992c-2dd4d8f1484e

📥 Commits

Reviewing files that changed from the base of the PR and between e1a0f63 and 4b90de9.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • examples/app-vitest-workspace/app1/test/app.browser.spec.ts
  • examples/app-vitest-workspace/app1/vitest.browser.config.ts
  • examples/app-vitest-workspace/package.json
  • src/config.ts

Comment thread examples/app-vitest-workspace/app1/test/app.browser.spec.ts
@socket-security

socket-security Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednuxt-nightly@​5.0.0-29736940.cd1355ed7810010097100

View full report

@danielroe
danielroe merged commit e8d2301 into nuxt:main Jul 17, 2026
10 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 17, 2026
@yamachi4416
yamachi4416 deleted the fix-vitest-projects-browser-mode branch July 18, 2026 04:33
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