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
@@ -206,7 +206,7 @@ When `sync` is `false`, the Vue component is rendered asynchronously.
206
206
207
207
## Other options
208
208
209
-
When the options for `mount` and `shallow` contain the options other than the mounting options, the component options are overwritten with those using [extends](https://vuejs.org/v2/api/#extends).
209
+
When the options for `mount` and `shallowMount` contain the options other than the mounting options, the component options are overwritten with those using [extends](https://vuejs.org/v2/api/#extends).
Copy file name to clipboardExpand all lines: docs/en/api/wrapper/README.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,8 @@ A `Wrapper` is an object that contains a mounted component or vnode and methods
8
8
9
9
`vm``Component`: this is the `Vue` instance. You can access all the [instance methods and properties of a vm](https://vuejs.org/v2/api/#Instance-Properties) with `wrapper.vm`. This only exists on Vue component wrappers
10
10
`element``HTMLElement`: the root DOM node of the wrapper
11
-
`options``Object`: Object containing Vue Test Utils options passed to `mount` or `shallow`
12
-
`options.attachedToDom``Boolean`: True if `attachToDom` was passed to `mount` or `shallow`
11
+
`options``Object`: Object containing Vue Test Utils options passed to `mount` or `shallowMount`
12
+
`options.attachedToDom``Boolean`: True if `attachToDom` was passed to `mount` or `shallowMount`
Copy file name to clipboardExpand all lines: docs/en/guides/common-tips.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -18,12 +18,12 @@ In unit tests, we typically want to focus on the component being tested as an is
18
18
19
19
In addition, for components that contain many child components, the entire rendered tree can get really big. Repeatedly rendering all child components could slow down our tests.
20
20
21
-
Vue Test Utils allows you to mount a component without rendering its child components (by stubbing them) with the `shallow` method:
21
+
Vue Test Utils allows you to mount a component without rendering its child components (by stubbing them) with the `shallowMount` method:
22
22
23
23
```js
24
-
import { shallow } from'@vue/test-utils'
24
+
import { shallowMount } from'@vue/test-utils'
25
25
26
-
constwrapper=shallow(Component) // returns a Wrapper containing a mounted Component instance
26
+
constwrapper=shallowMount(Component) // returns a Wrapper containing a mounted Component instance
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.
0 commit comments