Skip to content

Commit 4436f19

Browse files
committed
docs: update info on options.stub
1 parent 15178d1 commit 4436f19

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

docs/en/api/mount.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
`options.globals` (`Object`): Add globals to Vue instance.
3939

40-
`options.stub` ('Object): Stubs components matching the name passed with a string
40+
`options.stub` (`Object|Array<string>`): Stubs components matching the name. Takes object or array of strings
4141

4242
- **Usage:**
4343

@@ -117,7 +117,7 @@ describe('Foo', () => {
117117
})
118118
```
119119

120-
**Adding globals:**
120+
**Stubbing global properties:**
121121

122122
```js
123123
import { mount } from 'vue-test-utils'
@@ -128,7 +128,7 @@ describe('Foo', () => {
128128
it('renders a div', () => {
129129
const $route = { path: 'http://www.example-path.com' }
130130
const wrapper = mount(Foo, {
131-
globals: {
131+
intercept: {
132132
$route
133133
}
134134
})
@@ -143,13 +143,16 @@ describe('Foo', () => {
143143
import { mount } from 'vue-test-utils'
144144
import { expect } from 'chai'
145145
import Foo from './Foo.vue'
146-
import Bar from './Bar'
146+
import Bar from './Bar.vue'
147+
import Faz from './Faz.vue'
147148

148149
describe('Foo', () => {
149150
it('renders a div', () => {
150151
const wrapper = mount(Foo, {
151152
stub: {
152-
Bar: '<div class="stubbed />'
153+
Bar: '<div class="stubbed />',
154+
BarFoo: true,
155+
FooBar: Faz
153156
}
154157
})
155158
expect(wrapper.contains('.stubbed')).to.equal(true)

docs/en/api/shallow.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
`options.globals` (`Object`): Add globals to Vue instance.
3939

40-
`options.stub` ('Object): Stubs components matching the name passed with a string
40+
`options.stub` (`Object|Array<string>`): Stubs components matching the name. Takes object or array of strings
4141

4242
- **Usage:**
4343

@@ -121,7 +121,7 @@ describe('Foo', () => {
121121
})
122122
```
123123

124-
**Adding globals:**
124+
**Stubbing global properties:**
125125

126126
```js
127127
import { shallow } from 'vue-test-utils'
@@ -132,7 +132,7 @@ describe('Foo', () => {
132132
it('renders a div', () => {
133133
const $route = { path: 'http://www.example-path.com' }
134134
const wrapper = shallow(Foo, {
135-
globals: {
135+
intercept: {
136136
$route
137137
}
138138
})

0 commit comments

Comments
 (0)