test(e2e): centralize log expectations with shared constants#6815
Merged
chenjiahan merged 1 commit intomainfrom Dec 22, 2025
Merged
test(e2e): centralize log expectations with shared constants#6815chenjiahan merged 1 commit intomainfrom
chenjiahan merged 1 commit intomainfrom
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 e2e tests to use shared constants for commonly checked log messages and overlay selectors, replacing hardcoded strings with centralized definitions. This improves test maintainability by providing a single source of truth for these values.
- Introduces five new constants:
HMR_CONNECTED_LOG,MODULE_BUILD_FAILED_LOG,OVERLAY_ID, andOVERLAY_TITLE_BUILD_FAILED - Replaces hardcoded strings across overlay, HMR, and browser-logs test suites
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
e2e/helper/constants.ts |
Adds five new exported constants for HMR connection logs, build failure messages, and overlay selectors/titles |
e2e/cases/overlay/type-errors/index.test.ts |
Updates overlay selector and title assertions to use OVERLAY_ID and OVERLAY_TITLE_BUILD_FAILED constants |
e2e/cases/overlay/runtime-errors/index.test.ts |
Replaces hardcoded HMR log string and overlay selector with HMR_CONNECTED_LOG and OVERLAY_ID constants |
e2e/cases/overlay/disabled/index.test.ts |
Replaces hardcoded log expectations and overlay selector with HMR_CONNECTED_LOG, MODULE_BUILD_FAILED_LOG, and OVERLAY_ID constants |
e2e/cases/overlay/basic/index.test.ts |
Updates all hardcoded log strings and overlay assertions to use the four new constants |
e2e/cases/hmr/log-level/index.test.ts |
Replaces hardcoded HMR connection log strings with HMR_CONNECTED_LOG constant |
e2e/cases/hmr/error-recovery/index.test.ts |
Updates build failure log expectation to use MODULE_BUILD_FAILED_LOG constant |
e2e/cases/browser-logs/skip-build-error/index.test.ts |
Replaces hardcoded build failure log string with MODULE_BUILD_FAILED_LOG constant |
💡 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
Checklist