Skip to content

test(e2e): fix the expectNoLog helper#6872

Merged
chenjiahan merged 2 commits intomainfrom
fix_expect_no_log_1231
Dec 31, 2025
Merged

test(e2e): fix the expectNoLog helper#6872
chenjiahan merged 2 commits intomainfrom
fix_expect_no_log_1231

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

Summary

Updated expectNoLog e2e helper to throw an error with detailed information when an unexpected log is found, instead of returning a boolean.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings December 31, 2025 09:03
@netlify
Copy link
Copy Markdown

netlify bot commented Dec 31, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 8994189
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/6954e80c6ce5ed0008e40a60
😎 Deploy Preview https://deploy-preview-6872--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 69 (🟢 up 5 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the expectNoLog e2e test helper to throw errors instead of returning a boolean value, making it consistent with assertion-based testing patterns and improving test failure diagnostics.

  • Changed expectNoLog to throw an error with detailed information when an unexpected log is found
  • Updated test calls to remove boolean assertion wrappers (expect(...).toBe(true))
  • Fixed a test bug where expectNoLog was incorrectly used instead of expectLog

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
e2e/helper/logs.ts Updated expectNoLog to throw an error with formatted message instead of returning a boolean
e2e/cases/server/print-urls/index.test.ts Fixed incorrect use of expectNoLog - changed to expectLog to properly verify network URL is printed
e2e/cases/hmr/log-level/index.test.ts Removed boolean assertion wrappers around expectNoLog calls (4 occurrences) since the function now throws on failure

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chenjiahan chenjiahan merged commit d9ffb70 into main Dec 31, 2025
10 checks passed
@chenjiahan chenjiahan deleted the fix_expect_no_log_1231 branch December 31, 2025 09:18
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