testing-library / testing-library/eslint-plugin-testing-library
Report act from react-test-renderer
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.1k
- Forks
- 168
- Avg merge
- 15h 44m
- Merged PRs (30d)
- 14
Description
What rule do you want to change?
no-unnecessary-act
Does this change cause the rule to produce more or fewer warnings?
More warnings
How will the change be implemented?
As discussed in https://github.com/testing-library/eslint-plugin-testing-library/discussions/488 the act method from react-test-renderer must be reported too.
Example code
import { act } from "react-test-renderer";
import { fireEvent } from "@testing-library/react-native";
act(() => {
...fireEvent..
})
How does the current rule affect the code?
act is not reported since it's imported from react-test-renderer
How will the new rule affect the code?
act imported from react-test-renderer should be reported too.
Anything else?
No response
Do you want to submit a pull request to change the rule?
Yes
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the no-unnecessary-act rule and inspect how imported act sources are identified. Compare the existing behavior with the react-test-renderer example; done when that import is reported as an unnecessary act and existing behavior remains covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- testing, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100