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
Update documentation to explain differences between using `localVue` and `mocks` and provide examples of the use case for each.
A common gotcha with integration testing (which don't stub children) is when using the `mocks` approach the router instance is not available on child components.
The router instance is available to all children components, this is useful for integration level testing.
57
+
55
58
### Mocking `$route` and `$router`
56
59
57
60
Sometimes you want to test that a component does something with parameters from the `$route` and `$router` objects. To do that, you can pass custom mocks to the Vue instance.
> **Note:** the mocked `$route` and `$router` values are not available to children components, either stub this components or use the `localVue` method.
79
+
75
80
### Common gotchas
76
81
77
82
Installing Vue Router adds `$route` and `$router` as read-only properties on Vue prototype.
0 commit comments