File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -20,13 +20,13 @@ Example of **incorrect** code for this rule:
20
20
``` js
21
21
const foo = async () => {
22
22
await waitFor (() => {
23
- expect (window .fetch ).toHaveBeenCalledWith ( ' /foo ' );
23
+ expect (window .fetch ).toHaveBeenCalledTimes ( 1 );
24
24
expect (window .fetch ).toHaveBeenCalledWith (' /foo' );
25
25
});
26
26
27
27
// or
28
28
await waitFor (function () {
29
- expect (window .fetch ).toHaveBeenCalledWith ( ' /foo ' );
29
+ expect (window .fetch ).toHaveBeenCalledTimes ( 1 );
30
30
expect (window .fetch ).toHaveBeenCalledWith (' /foo' );
31
31
});
32
32
};
@@ -36,14 +36,14 @@ Examples of **correct** code for this rule:
36
36
37
37
``` js
38
38
const foo = async () => {
39
- await waitFor (() => expect (window .fetch ).toHaveBeenCalledWith ( ' foo ' ) );
40
- expect (window .fetch ).toHaveBeenCalledTimes ( 1 );
39
+ await waitFor (() => expect (window .fetch ).toHaveBeenCalledTimes ( 1 );
40
+ expect (window .fetch ).toHaveBeenCalledWith ( ' /foo ' );
41
41
42
42
// or
43
43
await waitFor (function () {
44
- expect (window .fetch ).toHaveBeenCalledWith ( ' foo ' );
44
+ expect (window .fetch ).toHaveBeenCalledTimes ( 1 );
45
45
});
46
- expect (window .fetch ).toHaveBeenCalledTimes ( 1 );
46
+ expect (window .fetch ).toHaveBeenCalledWith ( ' /foo ' );
47
47
48
48
// it only detects expect
49
49
// so this case doesn't generate warnings
You can’t perform that action at this time.
0 commit comments