Skip to content

fix(config): default nuxt test pattern to nested for simple non-nuxt setup - #1801

Merged
danielroe merged 1 commit into
nuxt:mainfrom
yamachi4416:fix-default-nuxt-tests-pattern-to-nested
Sep 2, 2026
Merged

fix(config): default nuxt test pattern to nested for simple non-nuxt setup#1801
danielroe merged 1 commit into
nuxt:mainfrom
yamachi4416:fix-default-nuxt-tests-pattern-to-nested

Conversation

@yamachi4416

@yamachi4416 yamachi4416 commented Sep 2, 2026

Copy link
Copy Markdown
Member

🔗 Linked issue

resolves #1800

📚 Description

Updated the nuxt test pattern for the simple non-nuxt setup to allow organizing tests into subdirectories. 

Reproduction:
https://stackblitz.com/edit/nuxt-test-utils-issues-1800?file=package.json&startScript=test

@pkg-pr-new

pkg-pr-new Bot commented Sep 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 8e10772

@yamachi4416
yamachi4416 marked this pull request as ready for review September 2, 2026 11:40
@coderabbitai

coderabbitai Bot commented Sep 2, 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: Team

Run ID: 3c88f8aa-759c-4d9b-a3ad-9d372de14aba

📥 Commits

Reviewing files that changed from the base of the PR and between c42f9a8 and 8e10772.

📒 Files selected for processing (9)
  • src/config.ts
  • test/fixtures/simple/env-none-include/test/nuxt/nest/test1.test.ts
  • test/fixtures/simple/env-none-include/test/nuxt/test.spec.ts
  • test/fixtures/simple/env-none/test/nuxt/nest/test1.test.ts
  • test/fixtures/simple/env-none/test/nuxt/test.spec.ts
  • test/fixtures/simple/env-other/test/nuxt/nest/test1.nuxt.spec.ts
  • test/fixtures/simple/env-other/test/nuxt/nest/test1.test.ts
  • test/fixtures/simple/env-other/test/nuxt/test.spec.ts
  • test/unit/resolve-config.spec.ts

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

Nuxt test discovery now matches supported test and spec extensions under nested test/nuxt and tests/nuxt directories. The default Vitest project excludes files assigned to the Nuxt project. Fixture tests verify the Nuxt environment marker for top-level and nested files. Configuration tests update expected file lists for the affected fixtures.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 8e107

This localized change broadens default Nuxt test discovery to support nested test directories while restricting matches to supported test files, with focused fixture coverage. No actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 9 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the configuration fix and the change to support nested Nuxt tests in simple non-Nuxt setups.
Description check ✅ Passed The description explains the nested test discovery problem, links issue #1800, and describes the intended recursive pattern change.
Linked Issues check ✅ Passed The changes address issue #1800 by discovering nested Nuxt test files, excluding them from the default Node project, and adding regression coverage for the affected fixtures.
Out of Scope Changes check ✅ Passed All changes are limited to the Nuxt test-pattern configuration and related regression tests. No unrelated changes are present.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Some tools did not complete. Review the errors below.

🔧 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.

src/config.ts

Parsing error: Unexpected token {

test/unit/resolve-config.spec.ts

Parsing error: Unexpected token {


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.

@danielroe
danielroe merged commit 0c4d111 into nuxt:main Sep 2, 2026
11 checks passed
@github-actions github-actions Bot mentioned this pull request Sep 2, 2026
@yamachi4416
yamachi4416 deleted the fix-default-nuxt-tests-pattern-to-nested branch September 3, 2026 10:46
@github-actions github-actions Bot mentioned this pull request Sep 6, 2026
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.

Default test/nuxt glob does not match nested tests

2 participants