Skip to content

Commit 7026e6d

Browse files
committed
test: add failing test for await-async-query false positive
1 parent a50f9ac commit 7026e6d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/lib/rules/await-async-query.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ ruleTester.run('await-async-query', rule, {
3434
`,
3535
})),
3636

37+
// async queries saving element in var with await operator are valid
38+
...ASYNC_QUERIES_COMBINATIONS.map(query => ({
39+
code: `async () => {
40+
doSomething()
41+
const foo = await ${query}('foo')
42+
expect(foo).toBeInTheDocument();
43+
}
44+
`,
45+
})),
46+
3747
// async queries with promise in variable and await operator are valid
3848
...ASYNC_QUERIES_COMBINATIONS.map(query => ({
3949
code: `async () => {

0 commit comments

Comments
 (0)