Skip to content

Commit 290be49

Browse files
38elementseddyerburgh
authored andcommitted
docs: update README.md (#588)
1 parent 33a6731 commit 290be49

34 files changed

+129
-129
lines changed

docs/en/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Vue Test Utils is the official unit testing utility library for Vue.js.
1717
* [Using with Vuex](guides/using-with-vuex.md)
1818
* [API](api/README.md)
1919
* [mount](api/mount.md)
20-
* [shallow](api/shallow.md)
20+
* [shallowMount](api/shallowMount.md)
2121
* [render](api/render.md)
2222
* [renderToString](api/renderToString.md)
2323
* [Mounting Options](api/options.md)

docs/en/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* [Using with Vuex](guides/using-with-vuex.md)
1414
* [API](api/README.md)
1515
* [mount](api/mount.md)
16-
* [shallow](api/shallow.md)
16+
* [shallowMount](api/shallowMount.md)
1717
* [render](api/render.md)
1818
* [renderToString](api/renderToString.md)
1919
* [Mounting Options](api/options.md)

docs/en/api/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# API
22

33
* [mount](./mount.md)
4-
* [shallow](./shallow.md)
4+
* [shallowMount](./shallowMount.md)
55
* [render](./render.md)
66
* [renderToString](./renderToString.md)
77
* [Mounting Options](./options.md)

docs/en/api/createLocalVue.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
Use it with `options.localVue`:
1111

1212
```js
13-
import { createLocalVue, shallow } from '@vue/test-utils'
13+
import { createLocalVue, shallowMount } from '@vue/test-utils'
1414
import Foo from './Foo.vue'
1515

1616
const localVue = createLocalVue()
17-
const wrapper = shallow(Foo, {
17+
const wrapper = shallowMount(Foo, {
1818
localVue,
1919
mocks: { foo: true }
2020
})
2121
expect(wrapper.vm.foo).toBe(true)
2222

23-
const freshWrapper = shallow(Foo)
23+
const freshWrapper = shallowMount(Foo)
2424
expect(freshWrapper.vm.foo).toBe(false)
2525
```
2626

docs/en/api/options.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Mounting Options
22

3-
Options for `mount` and `shallow`. The options object can contain both Vue Test Utils mounting options and other options.
3+
Options for `mount` and `shallowMount`. The options object can contain both Vue Test Utils mounting options and other options.
44

55
## Vue Test Utils Specific Mounting Options
66

@@ -50,7 +50,7 @@ Example:
5050
import Foo from './Foo.vue'
5151
import Bar from './Bar.vue'
5252

53-
const wrapper = shallow(Component, {
53+
const wrapper = shallowMount(Component, {
5454
slots: {
5555
default: [Foo, Bar],
5656
fooBar: Foo, // Will match `<slot name="FooBar" />`.
@@ -87,7 +87,7 @@ You can use [Puppeteer](https://github.com/karma-runner/karma-chrome-launcher#he
8787
Example:
8888

8989
```js
90-
const wrapper = shallow(Component, {
90+
const wrapper = shallowMount(Component, {
9191
scopedSlots: {
9292
foo: '<p slot-scope="props">{{props.index}},{{props.text}}</p>'
9393
}
@@ -110,7 +110,7 @@ mount(Component, {
110110
stubs: ['registered-component']
111111
})
112112

113-
shallow(Component, {
113+
shallowMount(Component, {
114114
stubs: {
115115
// stub with a specific implementation
116116
'registered-component': Foo,
@@ -130,7 +130,7 @@ Example:
130130

131131
```js
132132
const $route = { path: 'http://www.example-path.com' }
133-
const wrapper = shallow(Component, {
133+
const wrapper = shallowMount(Component, {
134134
mocks: {
135135
$route
136136
}
@@ -206,7 +206,7 @@ When `sync` is `false`, the Vue component is rendered asynchronously.
206206

207207
## Other options
208208

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).
210210

211211
```js
212212
const Component = {

docs/en/api/selectors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ export default {
3232
```
3333

3434
```js
35-
import { shallow } from '@vue/test-utils'
35+
import { shallowMount } from '@vue/test-utils'
3636
import Foo from './Foo.vue'
3737

38-
const wrapper = shallow(Foo)
38+
const wrapper = shallowMount(Foo)
3939
expect(wrapper.is(Foo)).toBe(true)
4040
```
4141

docs/en/api/shallow.md renamed to docs/en/api/shallowMount.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# `shallow(component [, options])`
1+
# `shallowMount(component [, options])`
22

33
- **Arguments:**
44

@@ -27,12 +27,12 @@ Like [`mount`](mount.md), it creates a [`Wrapper`](wrapper/README.md) that conta
2727
**Without options:**
2828

2929
```js
30-
import { shallow } from '@vue/test-utils'
30+
import { shallowMount } from '@vue/test-utils'
3131
import Foo from './Foo.vue'
3232

3333
describe('Foo', () => {
3434
it('renders a div', () => {
35-
const wrapper = shallow(Foo)
35+
const wrapper = shallowMount(Foo)
3636
expect(wrapper.contains('div')).toBe(true)
3737
})
3838
})
@@ -41,12 +41,12 @@ describe('Foo', () => {
4141
**With Vue options:**
4242

4343
```js
44-
import { shallow } from '@vue/test-utils'
44+
import { shallowMount } from '@vue/test-utils'
4545
import Foo from './Foo.vue'
4646

4747
describe('Foo', () => {
4848
it('renders a div', () => {
49-
const wrapper = shallow(Foo, {
49+
const wrapper = shallowMount(Foo, {
5050
propsData: {
5151
color: 'red'
5252
}
@@ -59,12 +59,12 @@ describe('Foo', () => {
5959
**Attach to DOM:**
6060

6161
```js
62-
import { shallow } from '@vue/test-utils'
62+
import { shallowMount } from '@vue/test-utils'
6363
import Foo from './Foo.vue'
6464

6565
describe('Foo', () => {
6666
it('renders a div', () => {
67-
const wrapper = shallow(Foo, {
67+
const wrapper = shallowMount(Foo, {
6868
attachToDocument: true
6969
})
7070
expect(wrapper.contains('div')).toBe(true)
@@ -75,14 +75,14 @@ describe('Foo', () => {
7575
**Default and named slots:**
7676

7777
```js
78-
import { shallow } from '@vue/test-utils'
78+
import { shallowMount } from '@vue/test-utils'
7979
import Foo from './Foo.vue'
8080
import Bar from './Bar.vue'
8181
import FooBar from './FooBar.vue'
8282

8383
describe('Foo', () => {
8484
it('renders a div', () => {
85-
const wrapper = shallow(Foo, {
85+
const wrapper = shallowMount(Foo, {
8686
slots: {
8787
default: [Bar, FooBar],
8888
fooBar: FooBar, // Will match <slot name="FooBar" />,
@@ -97,13 +97,13 @@ describe('Foo', () => {
9797
**Stubbing global properties:**
9898

9999
```js
100-
import { shallow } from '@vue/test-utils'
100+
import { shallowMount } from '@vue/test-utils'
101101
import Foo from './Foo.vue'
102102

103103
describe('Foo', () => {
104104
it('renders a div', () => {
105105
const $route = { path: 'http://www.example-path.com' }
106-
const wrapper = shallow(Foo, {
106+
const wrapper = shallowMount(Foo, {
107107
mocks: {
108108
$route
109109
}

docs/en/api/wrapper-array/at.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ Returns `Wrapper` at `index` passed. Uses zero based numbering (i.e. first item
1010
- **Example:**
1111

1212
```js
13-
import { shallow } from '@vue/test-utils'
13+
import { shallowMount } from '@vue/test-utils'
1414
import Foo from './Foo.vue'
1515

16-
const wrapper = shallow(Foo)
16+
const wrapper = shallowMount(Foo)
1717
const divArray = wrapper.findAll('div')
1818
const secondDiv = divArray.at(1)
1919
expect(secondDiv.is('p')).toBe(true)

docs/en/api/wrapper-array/contains.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ Use any valid [selector](../selectors.md).
1212
- **Example:**
1313

1414
```js
15-
import { shallow } from '@vue/test-utils'
15+
import { shallowMount } from '@vue/test-utils'
1616
import Foo from './Foo.vue'
1717
import Bar from './Bar.vue'
1818

19-
const wrapper = shallow(Foo)
19+
const wrapper = shallowMount(Foo)
2020
const divArray = wrapper.findAll('div')
2121
expect(divArray.contains('p')).toBe(true)
2222
expect(divArray.contains(Bar)).toBe(true)

docs/en/api/wrapper-array/filter.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ A new `WrapperArray` instance containing `Wrapper` instances that returns true f
1414
- **Example:**
1515

1616
```js
17-
import { shallow } from '@vue/test-utils'
17+
import { shallowMount } from '@vue/test-utils'
1818
import Foo from './Foo.vue'
1919

20-
const wrapper = shallow(Foo)
20+
const wrapper = shallowMount(Foo)
2121
const filteredDivArray = wrapper.findAll('div').filter(w => !w.hasClass('filtered'))
2222
```

0 commit comments

Comments
 (0)