Skip to content

Commit 63f2db4

Browse files
committed
Merge remote-tracking branch 'origin/master' into v4
2 parents ac2d7ac + e5b54d7 commit 63f2db4

File tree

5 files changed

+42
-5
lines changed

5 files changed

+42
-5
lines changed

.all-contributorsrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@
271271
"profile": "https://nickmccurdy.com/",
272272
"contributions": [
273273
"ideas",
274-
"code"
274+
"code",
275+
"review"
275276
]
276277
},
277278
{

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
209209
<td align="center"><a href="https://xxxl.digital/"><img src="https://avatars2.githubusercontent.com/u/42043025?v=4" width="100px;" alt=""/><br /><sub><b>Miguel Erja González</b></sub></a><br /><a href="https://github.com/testing-library/eslint-plugin-testing-library/issues?q=author%3Amiguelerja" title="Bug reports">🐛</a></td>
210210
<td align="center"><a href="http://pustovalov.dev"><img src="https://avatars2.githubusercontent.com/u/1568885?v=4" width="100px;" alt=""/><br /><sub><b>Pavel Pustovalov</b></sub></a><br /><a href="https://github.com/testing-library/eslint-plugin-testing-library/issues?q=author%3Apustovalov" title="Bug reports">🐛</a></td>
211211
<td align="center"><a href="https://github.com/jrparish"><img src="https://avatars3.githubusercontent.com/u/5173987?v=4" width="100px;" alt=""/><br /><sub><b>Jacob Parish</b></sub></a><br /><a href="https://github.com/testing-library/eslint-plugin-testing-library/issues?q=author%3Ajrparish" title="Bug reports">🐛</a> <a href="https://github.com/testing-library/eslint-plugin-testing-library/commits?author=jrparish" title="Code">💻</a> <a href="https://github.com/testing-library/eslint-plugin-testing-library/commits?author=jrparish" title="Tests">⚠️</a></td>
212-
<td align="center"><a href="https://nickmccurdy.com/"><img src="https://avatars0.githubusercontent.com/u/927220?v=4" width="100px;" alt=""/><br /><sub><b>Nick McCurdy</b></sub></a><br /><a href="#ideas-nickmccurdy" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/testing-library/eslint-plugin-testing-library/commits?author=nickmccurdy" title="Code">💻</a></td>
212+
<td align="center"><a href="https://nickmccurdy.com/"><img src="https://avatars0.githubusercontent.com/u/927220?v=4" width="100px;" alt=""/><br /><sub><b>Nick McCurdy</b></sub></a><br /><a href="#ideas-nickmccurdy" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/testing-library/eslint-plugin-testing-library/commits?author=nickmccurdy" title="Code">💻</a> <a href="https://github.com/testing-library/eslint-plugin-testing-library/pulls?q=is%3Apr+reviewed-by%3Anickmccurdy" title="Reviewed Pull Requests">👀</a></td>
213213
<td align="center"><a href="https://stefancameron.com/"><img src="https://avatars3.githubusercontent.com/u/2855350?v=4" width="100px;" alt=""/><br /><sub><b>Stefan Cameron</b></sub></a><br /><a href="https://github.com/testing-library/eslint-plugin-testing-library/issues?q=author%3Astefcameron" title="Bug reports">🐛</a></td>
214214
</tr>
215215
</table>

docs/rules/prefer-screen-queries.md

+6
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ const utils = render(<Foo />);
5454
utils.rerender(<Foo />);
5555
utils.unmount();
5656
utils.asFragment();
57+
58+
// the same functions, but called from destructuring
59+
const { rerender, unmount, asFragment } = render(<Foo />);
60+
rerender(<Foo />);
61+
asFragment();
62+
unmount();
5763
```
5864

5965
## Further Reading

tests/lib/rules/prefer-screen-queries.test.ts

+21-3
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,39 @@ ruleTester.run(RULE_NAME, rule, {
4747
},
4848
{
4949
code: `
50-
const utils = render(baz);
51-
screen.rerender();
50+
const { rerender } = render(baz);
51+
rerender();
5252
`
5353
},
5454
{
5555
code: `
5656
const utils = render(baz);
57-
utils.unmount();
57+
utils.rerender();
5858
`
5959
},
6060
{
6161
code: `
6262
const utils = render(baz);
6363
utils.asFragment();
6464
`
65+
},
66+
{
67+
code: `
68+
const { asFragment } = render(baz);
69+
asFragment();
70+
`
71+
},
72+
{
73+
code: `
74+
const { unmount } = render(baz);
75+
unmount();
76+
`
77+
},
78+
{
79+
code: `
80+
const utils = render(baz);
81+
utils.unmount();
82+
`
6583
}
6684
],
6785

tests/lib/rules/prefer-wait-for.test.ts

+12
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ ruleTester.run(RULE_NAME, rule, {
6060
cy.wait();
6161
`,
6262
},
63+
{
64+
// https://github.com/testing-library/eslint-plugin-testing-library/issues/145
65+
code: `
66+
async function wait(): Promise<any> {
67+
// doesn't matter
68+
}
69+
70+
function callsWait(): void {
71+
await wait();
72+
}
73+
`,
74+
},
6375
],
6476

6577
invalid: [

0 commit comments

Comments
 (0)