Skip to content

test: add test for autoImport: false#1688

Merged
danielroe merged 2 commits intonuxt:mainfrom
yamachi4416:add-test-for-disable-autoimport
May 6, 2026
Merged

test: add test for autoImport: false#1688
danielroe merged 2 commits intonuxt:mainfrom
yamachi4416:add-test-for-disable-autoimport

Conversation

@yamachi4416
Copy link
Copy Markdown
Member

@yamachi4416 yamachi4416 commented May 6, 2026

🔗 Linked issue

📚 Description

Added a test case to verify behavior when autoImport: false.
This ensures we can catch any missing imports in runtime-utils during testing.

@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 6, 2026

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

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedsemver@​7.7.410010010086100
Addedmagic-string@​0.30.2110010010086100

View full report

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 6, 2026

Open in StackBlitz

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

commit: 97404eb

@yamachi4416 yamachi4416 force-pushed the add-test-for-disable-autoimport branch from ad7e1fb to 97404eb Compare May 6, 2026 12:39
@yamachi4416 yamachi4416 marked this pull request as ready for review May 6, 2026 13:00
@yamachi4416 yamachi4416 requested a review from danielroe as a code owner May 6, 2026 13:00
@danielroe danielroe merged commit 11d0ca5 into nuxt:main May 6, 2026
9 of 10 checks passed
@github-actions github-actions Bot mentioned this pull request May 6, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a2d99e03-9bef-473d-87bb-a3d2fe07e468

📥 Commits

Reviewing files that changed from the base of the PR and between c193a99 and 97404eb.

📒 Files selected for processing (15)
  • examples/app-vitest-full/tests/nuxt/mount-suspended.spec.ts
  • examples/app-vitest-workspace/app3/app.vue
  • examples/app-vitest-workspace/app3/app/components/Counter.vue
  • examples/app-vitest-workspace/app3/app/composables/useCounter.ts
  • examples/app-vitest-workspace/app3/app/pages/counter.vue
  • examples/app-vitest-workspace/app3/app/pages/index.vue
  • examples/app-vitest-workspace/app3/nuxt.config.ts
  • examples/app-vitest-workspace/app3/test/nuxt/mockNuxtImport.spec.ts
  • examples/app-vitest-workspace/app3/test/nuxt/mountSuspended.spec.ts
  • examples/app-vitest-workspace/app3/test/nuxt/registerEndpoint.spec.ts
  • examples/app-vitest-workspace/app3/test/nuxt/renderSuspended.spec.ts
  • examples/app-vitest-workspace/app3/tsconfig.json
  • examples/app-vitest-workspace/app3/vitest.config.ts
  • examples/app-vitest-workspace/package.json
  • examples/app-vitest-workspace/vitest.config.ts

📝 Walkthrough

Walkthrough

This pull request adds a complete new Nuxt application (app3) to the vitest-workspace examples directory, including Vue components (Counter), composables (useCounter), pages (index and counter), and comprehensive test coverage demonstrating mockNuxtImport, mountSuspended, renderSuspended, and registerEndpoint utilities. Additionally, the mount-suspended.spec.ts test in the main example is refactored to use externally hoisted mocks, the workspace package.json is updated to prepare app3, and the root vitest configuration adds console logging filtering for Suspense warnings.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@yamachi4416 yamachi4416 deleted the add-test-for-disable-autoimport branch May 6, 2026 14:51
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