From 81763464f525d00245d27ace36daffc4cc73e8c8 Mon Sep 17 00:00:00 2001 From: Sean Ray Date: Tue, 10 Oct 2017 23:11:02 -0400 Subject: [PATCH 1/2] Clarify nextTick section of getting-started guide Following up on #83, clarify getting started guide to explain that `nextTick` is not necessary when testing DOM updates, but it is still needed for operations that require advancing the event loop. --- docs/en/guides/getting-started.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/en/guides/getting-started.md b/docs/en/guides/getting-started.md index c732ac1a6..2818e8156 100644 --- a/docs/en/guides/getting-started.md +++ b/docs/en/guides/getting-started.md @@ -106,7 +106,9 @@ it('button click should increment the count', () => { Vue batches pending DOM updates and applies them asynchronously to prevent unnecessary re-renders caused by multiple data mutations. This is why in practice we often have to use `Vue.nextTick` to wait until Vue has performed the actual DOM update after we trigger some state change. -To simplify usage, `vue-test-utils` applies all updates synchronously so you don't need to use `Vue.nextTick` in your tests. +To simplify usage, `vue-test-utils` applies all updates synchronously so you don't need to use `Vue.nextTick` to test DOM updates in your tests. + +`nextTick` is still necessary when you need to explictly advance the event loop, for operations such as asynchronous callbacks or promise resolution. ## What's Next From af1342e398669e674335bd208f96d3af93749147 Mon Sep 17 00:00:00 2001 From: Sean Ray Date: Wed, 11 Oct 2017 08:12:53 -0400 Subject: [PATCH 2/2] Addressing getting started update PR notes - Putting change in a *Note: * - Changing wording, "to test DOM updates in your tests" felt awkward. --- docs/en/guides/getting-started.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/guides/getting-started.md b/docs/en/guides/getting-started.md index 2818e8156..5c023d6dc 100644 --- a/docs/en/guides/getting-started.md +++ b/docs/en/guides/getting-started.md @@ -106,9 +106,9 @@ it('button click should increment the count', () => { Vue batches pending DOM updates and applies them asynchronously to prevent unnecessary re-renders caused by multiple data mutations. This is why in practice we often have to use `Vue.nextTick` to wait until Vue has performed the actual DOM update after we trigger some state change. -To simplify usage, `vue-test-utils` applies all updates synchronously so you don't need to use `Vue.nextTick` to test DOM updates in your tests. +To simplify usage, `vue-test-utils` applies all updates synchronously so you don't need to use `Vue.nextTick` to wait for DOM updates in your tests. -`nextTick` is still necessary when you need to explictly advance the event loop, for operations such as asynchronous callbacks or promise resolution. +*Note: `nextTick` is still necessary when you need to explictly advance the event loop, for operations such as asynchronous callbacks or promise resolution.* ## What's Next