Skip to content

Commit

Permalink
docs(testing): removed sync mode from vueTestUtils
Browse files Browse the repository at this point in the history
Removed sync mode from vueTestUtils, since (it has been removed)[vuejs/vue-test-utils#1137].
Also add the import of flushPromises(). It took quite some time to find out that it was an external package.
  • Loading branch information
jeanremy authored Jul 22, 2020
1 parent bf93906 commit 9d13227
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions docs/advanced/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,12 @@ transformIgnorePatterns: [
The following examples will use vue-test-utils API to conduct the tests.
:::

VeeValidate is primarily asynchronous, so you would need to disable vue-test-utils sync mode. And you will use flush-promises to wait for the updated to take effect.

To disable the sync mode, when mounting the component set the sync option to false in the mounting options.

```js
const wrapper = mount(MyComponent, { sync: false });
```

After triggering an event like an input event, make sure to call flushPromises before checking the UI for changes:

```js
import flushPromises from 'flush-promises'

await flushPromises();
```

Expand Down

0 comments on commit 9d13227

Please sign in to comment.