Skip to content

Commit ef0dde3

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

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,24 @@ 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+
// Reference the import to make this test unique per framework
305+
const asyncUtil = waitFor
306+
307+
// These CallExpressions have no deepest identifier:
308+
const funcs = [() => console.log('test')]
309+
const obj = { [Symbol.iterator]: () => 'symbol' }
310+
311+
funcs[0]()
312+
obj[Symbol.iterator]()
313+
(function() { return 'iife' })()
314+
});
297315
`,
298316
},
299317
...ASYNC_UTILS.map((asyncUtil) => ({

0 commit comments

Comments
 (0)