Skip to content

Commit 99fa73e

Browse files
committed
fix: typo is flushPromises example
1 parent 0b143e8 commit 99fa73e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/guide/async-suspense.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jest.mock('axios', () => ({
7878
}))
7979
```
8080

81-
In this case, Vue has no knowledge of the unresolved Promise, so calling `nextTick` will not work - your assertion may run before it is resolved. For scenarios like this, you can use `[flush-promises](https://www.npmjs.com/package/flush-promises)`, which causes all outstanding promises to resolve immediately.
81+
In this case, Vue has no knowledge of the unresolved Promise, so calling `nextTick` will not work - your assertion may run before it is resolved. For scenarios like this, you can use `[flush-promises](https://www.npmjs.com/package/flush-promises)`, which causes all outstanding promises to resolve immediately.
8282

8383
Let's see an example:
8484

@@ -97,8 +97,8 @@ test('uses a mocked axios HTTP client and flush-promises', async () => {
9797
// some component that makes a HTTP called in `created` using `axios`
9898
const wrapper = mount(AxiosComponent)
9999

100-
await flushPromses() // axios promise is resolved immediately!
101-
100+
await flushPromises() // axios promise is resolved immediately!
101+
102102
// assertions!
103103
})
104104

@@ -110,4 +110,4 @@ test('uses a mocked axios HTTP client and flush-promises', async () => {
110110
- Vue updates the DOM asynchronously; tests runner execute code synchronously.
111111
- Use `await nextTick()` to ensure the DOM has updated before the test continues
112112
- Functions that might update the DOM, like `trigger` and `setValue` return `nextTick`, so you should `await` them.
113-
- Use `flush-promises` to resolve any unresolved promises from non-Vue dependencies.
113+
- Use `flush-promises` to resolve any unresolved promises from non-Vue dependencies.

0 commit comments

Comments
 (0)