Skip to content

Commit 1d77160

Browse files
committed
docs: update doc
1 parent 9a7199b commit 1d77160

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/rules/no-wait-for-multiple-assertions.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ Example of **incorrect** code for this rule:
2020
```js
2121
const 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
3838
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');
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

0 commit comments

Comments
 (0)