Skip to content

Commit e171f58

Browse files
authored
Merge pull request #1387 from suits-at/patch-1
fix: wait for the next tick
2 parents d291171 + edac70b commit e171f58

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: docs/guides/testing-single-file-components-with-mocha-webpack.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,15 @@ Create a file in `src` named `Counter.vue`:
148148
And create a test file named `test/Counter.spec.js` with the following code:
149149

150150
```js
151+
import Vue from 'vue'
151152
import { shallowMount } from '@vue/test-utils'
152153
import Counter from '../src/Counter.vue'
153154

154155
describe('Counter.vue', () => {
155-
it('increments count when button is clicked', () => {
156+
it('increments count when button is clicked', async () => {
156157
const wrapper = shallowMount(Counter)
157158
wrapper.find('button').trigger('click')
159+
await Vue.nextTick()
158160
expect(wrapper.find('div').text()).toMatch('1')
159161
})
160162
})

0 commit comments

Comments
 (0)