diff --git a/docs/guides/testing-single-file-components-with-mocha-webpack.md b/docs/guides/testing-single-file-components-with-mocha-webpack.md index ad2777972..cee57d924 100644 --- a/docs/guides/testing-single-file-components-with-mocha-webpack.md +++ b/docs/guides/testing-single-file-components-with-mocha-webpack.md @@ -148,13 +148,15 @@ Create a file in `src` named `Counter.vue`: And create a test file named `test/Counter.spec.js` with the following code: ```js +import Vue from 'vue' import { shallowMount } from '@vue/test-utils' import Counter from '../src/Counter.vue' describe('Counter.vue', () => { - it('increments count when button is clicked', () => { + it('increments count when button is clicked', async () => { const wrapper = shallowMount(Counter) wrapper.find('button').trigger('click') + await Vue.nextTick() expect(wrapper.find('div').text()).toMatch('1') }) })