-
-
Notifications
You must be signed in to change notification settings - Fork 637
Make RSC tests await act #1734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alexeyr-ci2
wants to merge
3
commits into
master
Choose a base branch
from
alexeyr/fix-rsc-tests
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Make RSC tests await act #1734
Conversation
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
## Walkthrough
The ESLint configuration for test files was extended to include the Testing Library plugin alongside existing Jest settings. The `eslint-plugin-testing-library` dependency was added, and the TypeScript ESLint plugin was upgraded. A test helper function was simplified by removing an async `act` wrapper. The package removal script was consolidated with broader regex patterns.
## Changes
| File(s) | Change Summary |
|---------------------------------|-------------------------------------------------------------------------------------------------|
| eslint.config.ts | Added `eslint-plugin-testing-library` recommended config for test files alongside Jest config. |
| package.json | Added `eslint-plugin-testing-library` (v7.4.0); upgraded `typescript-eslint` from 8.29.1 to 8.33.1. |
| node_package/tests/RSCClientRoot.test.jsx | Removed async `act` wrapper from `mockRSCRequest` helper’s `render` function, making it synchronous. |
| script/convert | Replaced multiple ESLint and Testing Library package removals with consolidated regex-based removals in package.json editing. |
## Sequence Diagram(s)
```mermaid
sequenceDiagram
participant TestHelper as mockRSCRequest.render
participant Component as RSCClientRoot
TestHelper->>Component: Call RSCClientRoot directly (no async act)
Note right of Component: Executes synchronously without awaiting Possibly related PRs
Suggested reviewers
Poem
|
5e381b4
to
9ec8d5f
Compare
9ec8d5f
to
11d72c2
Compare
e5700dc
to
a74f298
Compare
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
Tests in
node_package/tests/RSCClientRoot.test.jsx
were callingact
withoutawait
, leading to these warnings:and
Pull Request checklist
Add/update test to cover these changes
[ ] Update documentation[ ] Update CHANGELOG file(unless implementation ends up needing to change)Should add https://github.com/testing-library/eslint-plugin-testing-library and maybe https://github.com/testing-library/eslint-plugin-jest-dom to prevent the issue repeating.
This change is
Summary by CodeRabbit
Chores
Tests