Un-report react-test-renderer's findByType & findAllByType queries as async.
See original GitHub issueWhat rule do you want to change?
await-async-query
Does this change cause the rule to produce more or fewer warnings?
Fewer warnings
How will the change be implemented?
Check that given node does not end with ‘ByType’.
Example code
const elements = root.findAllByType('div')
How does the current rule affect the code?
promise returned from `findAllByType` query must be handled
How will the new rule affect the code?
This rule will not be applied if the query ends with ‘ByType’.
Anything else?
No response
Do you want to submit a pull request to change the rule?
Yes
Issue Analytics
- State:
- Created a year ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
react-test-renderer: promise returned from `findByProps` query ...
Steps To Reproduce. create a ReactTestInstance using create from react-test-renderer · The current behavior. Eslint(testing-library/await-async- ...
Read more >Test Renderer - React
This package provides a React renderer that can be used to render React components to pure JavaScript objects, without depending on the DOM...
Read more >Testing Library findBy* queries only working with async/await
But it seems like using these queries with Promise.prototype.catch() doesn't work in cases where using them with async/await + try...catch ...
Read more >react-test-renderer.ReactTestInstance.findAllByType ... - Tabnine
Similar to `ReactDOM.render` but it doesn't require DOM and only renders a single level deep. ReactTestRenderer.toJSON · ReactTestInstance.props, ...
Read more >TDD with React Test Renderer - LogRocket Blog
root; // [ 3 ] query for element const element = root.findByType("div"); // [ 4 ] assert that ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes. I’ve created #673 to stop reporting utils from
react-test-renderer
.Closing in favor of #673