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:
2020``` js
2121const foo = async () => {
2222 await waitFor (() => {
23- expect (window .fetch ).toHaveBeenCalledWith ( ' /foo ' );
23+ expect (window .fetch ).toHaveBeenCalledTimes ( 1 );
2424 expect (window .fetch ).toHaveBeenCalledWith (' /foo' );
2525 });
2626
2727 // or
2828 await waitFor (function () {
29- expect (window .fetch ).toHaveBeenCalledWith ( ' /foo ' );
29+ expect (window .fetch ).toHaveBeenCalledTimes ( 1 );
3030 expect (window .fetch ).toHaveBeenCalledWith (' /foo' );
3131 });
3232};
@@ -36,14 +36,14 @@ Examples of **correct** code for this rule:
3636
3737``` js
3838const 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 ' );
4141
4242 // or
4343 await waitFor (function () {
44- expect (window .fetch ).toHaveBeenCalledWith ( ' foo ' );
44+ expect (window .fetch ).toHaveBeenCalledTimes ( 1 );
4545 });
46- expect (window .fetch ).toHaveBeenCalledTimes ( 1 );
46+ expect (window .fetch ).toHaveBeenCalledWith ( ' /foo ' );
4747
4848 // it only detects expect
4949 // so this case doesn't generate warnings
You can’t perform that action at this time.
0 commit comments