Skip to content

Commit 36b3bec

Browse files
author
Charley
committed
test: add coverage edge case
1 parent eca0fac commit 36b3bec

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,23 @@ ruleTester.run(RULE_NAME, rule, {
294294
test('edge case for no innermost function scope', () => {
295295
const foo = waitFor
296296
})
297+
`,
298+
},
299+
{
300+
// edge case for coverage: CallExpressions without deepest identifiers
301+
code: `
302+
import { waitFor } from '${testingFramework}';
303+
test('coverage test for CallExpressions without identifiers', () => {
304+
const asyncUtil = waitFor
305+
306+
// These CallExpressions have no deepest identifier:
307+
const funcs = [() => console.log('test')]
308+
const obj = { [Symbol.iterator]: () => 'symbol' }
309+
310+
funcs[0]()
311+
obj[Symbol.iterator]()
312+
(function() { return 'iife' })()
313+
});
297314
`,
298315
},
299316
...ASYNC_UTILS.map((asyncUtil) => ({

0 commit comments

Comments
 (0)