Skip to content

Commit a595532

Browse files
author
Charley
committed
test: one more test
1 parent 63def3a commit a595532

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/lib/rules/await-async-queries.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,23 @@ ruleTester.run(RULE_NAME, rule, {
291291
`,
292292
})),
293293

294+
// handled promise assigned to variable returned from async query wrapper is valid
295+
...ALL_ASYNC_COMBINATIONS_TO_TEST.map(
296+
(query) =>
297+
({
298+
code: `
299+
const queryWrapper = () => {
300+
return screen.${query}('foo')
301+
}
302+
303+
test("A valid example test", async () => {
304+
const element = await queryWrapper()
305+
expect(element).toBeVisible()
306+
})
307+
`,
308+
}) as const
309+
),
310+
294311
// non-matching query is valid
295312
`
296313
test('A valid example test', async () => {

0 commit comments

Comments
 (0)