From 722f380cdab00dda0622cb78816a34d983cbee2c Mon Sep 17 00:00:00 2001 From: Kumar Gaurav Date: Fri, 21 Feb 2020 16:03:49 +0530 Subject: [PATCH 1/2] Missing Vue import `import Vue` was missing in the code block. when someone, new to vue tries to follow the guide, it becomes a pain-point to figure why test case which included `Vue.nextTick()` failed. --- docs/guides/testing-async-components.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/guides/testing-async-components.md b/docs/guides/testing-async-components.md index d9bcb9bf4..53bb48838 100644 --- a/docs/guides/testing-async-components.md +++ b/docs/guides/testing-async-components.md @@ -16,6 +16,13 @@ In practice, this means you have to use `Vue.nextTick()` to wait until Vue has p The easiest way to use `Vue.nextTick()` is to write your tests in an async function: ```js +// import Vue at the top of file +import Vue from 'vue' + +... +... + +// inside test-suite, add this test case it('button click should increment the count text', async () => { expect(wrapper.text()).toContain('0') const button = wrapper.find('button') From 7aff425cd6464c2dc7e9dd83026d2cd6c1620add Mon Sep 17 00:00:00 2001 From: Kumar Gaurav Date: Sat, 22 Feb 2020 17:35:22 +0530 Subject: [PATCH 2/2] Update testing-async-components.md --- docs/guides/testing-async-components.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/guides/testing-async-components.md b/docs/guides/testing-async-components.md index 53bb48838..e62b09bf6 100644 --- a/docs/guides/testing-async-components.md +++ b/docs/guides/testing-async-components.md @@ -19,8 +19,7 @@ The easiest way to use `Vue.nextTick()` is to write your tests in an async funct // import Vue at the top of file import Vue from 'vue' -... -... +// other code snippet... // inside test-suite, add this test case it('button click should increment the count text', async () => {