You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: docs/en/guides/getting-started.md
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -106,7 +106,9 @@ it('button click should increment the count', () => {
106
106
107
107
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.
108
108
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.*
0 commit comments