Skip to content

Commit 8ab31c1

Browse files
mdjastrzebskithymikee
authored andcommitted
docs: final tweaks
1 parent 68654f4 commit 8ab31c1

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

website/docs/EslintPLluginTestingLibrary.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ title: ESLint Plugin Testing Library Compatibility
66

77
Most of the rules of the [eslint-plugin-testing-library](https://github.com/testing-library/eslint-plugin-testing-library) are compatible with this library except the followings:
88

9-
- [prefer-screen-queries](https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/prefer-screen-queries.md): there is no screen object so this rule shouldn't be used
10-
119
- [prefer-user-event](https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/prefer-user-event.md): userEvent requires a dom environement so it is not compatible with this library
1210

1311
Also, some rules have become useless, unless maybe you're using an old version of the library:

website/docs/FAQ.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,15 @@ The the negative side:
3131
For instance, [react-native's ScrollView](https://reactnative.dev/docs/scrollview) has several props that depend on native calls. While you can trigger `onScroll` call with `fireEvent.scroll`, `onMomentumScrollBegin` is called from the native side and will therefore not be called.
3232

3333
</details>
34+
35+
<details>
36+
<summary>Should I use/migrate to `screen` queries?</summary>
37+
38+
<br />
39+
40+
There is no need to migrate existing test code to use `screen`-bases queries. You can still use
41+
queries and other functions returned by `render`. In fact `screen` hold just that value, the latest `render` result.
42+
43+
For newer code you can either use `screen` or `render` result destructuring. However, there are some good reasons to use `screen`, which are described in [this article](https://kentcdodds.com/blog/common-mistakes-with-react-testing-library#not-using-screen) by Kent C. Dodds.
44+
45+
</details>

0 commit comments

Comments
 (0)