test(e2e): fix the expectNoLog helper#6872
Merged
chenjiahan merged 2 commits intomainfrom Dec 31, 2025
Merged
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
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
expectNoLogto 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
expectNoLogwas incorrectly used instead ofexpectLog
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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