Skip to content

Commit eef3792

Browse files
skrayeddyerburgh
authored andcommitted
docs: clarify nextTick section of getting-started guide (#86)
* 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. * Addressing getting started update PR notes - Putting change in a *Note: * - Changing wording, "to test DOM updates in your tests" felt awkward.
1 parent da84f1b commit eef3792

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/en/guides/getting-started.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ it('button click should increment the count', () => {
106106

107107
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.
108108

109-
To simplify usage, `vue-test-utils` applies all updates synchronously so you don't need to use `Vue.nextTick` in your tests.
109+
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.
110+
111+
*Note: `nextTick` is still necessary when you need to explictly advance the event loop, for operations such as asynchronous callbacks or promise resolution.*
110112

111113
## What's Next
112114

0 commit comments

Comments
 (0)