Skip to content

Commit 0ef8935

Browse files
authored
Added extended tests for no unnecessary waiting to handle const situations.
1 parent 722ad51 commit 0ef8935

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/lib/rules/no-unnecessary-waiting.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@ ruleTester.run('no-unnecessary-waiting', rule, {
1818
{ code: 'cy.clock(5000)', parserOptions },
1919
{ code: 'cy.scrollTo(0, 10)', parserOptions },
2020
{ code: 'cy.tick(500)', parserOptions },
21+
22+
{ code: 'const someRequest="@someRequest"; cy.wait(someRequest)', parserOptions, errors },
2123
],
2224

2325
invalid: [
2426
{ code: 'cy.wait(0)', parserOptions, errors },
2527
{ code: 'cy.wait(100)', parserOptions, errors },
2628
{ code: 'cy.wait(5000)', parserOptions, errors },
29+
{ code: 'const someNumber=500; cy.wait(someNumber)', parserOptions, errors },
2730
],
2831
})

0 commit comments

Comments
 (0)