Skip to content

fix(e2e): restore console after use nuxt kit - #1817

Open
yamachi4416 wants to merge 1 commit into
nuxt:mainfrom
yamachi4416:fix-e2e-console
Open

yamachi4416 wants to merge 1 commit into
nuxt:mainfrom
yamachi4416:fix-e2e-console

Conversation

@yamachi4416

@yamachi4416 yamachi4416 commented Sep 12, 2026

Copy link
Copy Markdown
Member

🔗 Linked issue

resolves #350
resolves #795

📚 Description

add logger.restoreAll() after buildNuxt and loadNuxt to restore console output captured by consola.

Reproductin

@pkg-pr-new

pkg-pr-new Bot commented Sep 12, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 0434f25

@yamachi4416 yamachi4416 changed the title fix(e2e): restore console after nuxt setup fix(e2e): restore console after use nuxt kit Sep 12, 2026
@yamachi4416
yamachi4416 marked this pull request as ready for review September 12, 2026 07:14
@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 50bc7386-9beb-4f62-916d-30a6bfba0a4e

📥 Commits

Reviewing files that changed from the base of the PR and between 517f137 and 0434f25.

📒 Files selected for processing (6)
  • examples/app-vitest/test/e2e/server-logs.spec.ts
  • src/e2e/nuxt.ts
  • test/fixtures/output-console/nuxt.config.ts
  • test/fixtures/output-console/test/test1.spec.ts
  • test/fixtures/output-console/tsconfig.json
  • test/unit/output-console.spec.ts

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


📝 Walkthrough

Walkthrough

The change restores logger state after Nuxt fixture loading and building, including failed operations. It adds an output-console Nuxt fixture and integration test that verify logs from beforeAll, beforeEach, and a test. It also corrects the rootDir resolution in the app-vitest e2e example.

Priority: ➖ Normal

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

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 0434f

The change is mergeable with normal checks; logger restoration and console-output coverage introduce no demonstrated merge-blocking risk.

🚥 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 2 functions across 5 files. (1 skipped: 1 … 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 describes restoring console output after Nuxt Kit use in end-to-end tests.
Description check ✅ Passed The description directly explains the console restoration change, linked issues, reproduction cases, and intended test behavior.
Linked Issues check ✅ Passed The change addresses [#350] and [#795]. loadFixture() calls logger.restoreAll() after loadNuxt(), including failure paths. buildFixture() restores the logger level and calls `logger.restoreAll…
Out of Scope Changes check ✅ Passed The changes stay within the linked issue scope. The logger restoration implements the fix. The output-console fixture and test provide regression coverage. The server-log test move and rootDir updat…
Full details: Docstring Coverage

Explanation

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 2 functions across 5 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ 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.

This branch has not been deployed

No deployments
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.

e2e tests dont show any console logs in stdout and in vitest/ui @nuxt/test-utils -- setup() clobbers console.log() functionality

1 participant