File tree Expand file tree Collapse file tree 6 files changed +15
-15
lines changed
packages/test-utils/types Expand file tree Collapse file tree 6 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -56,9 +56,7 @@ Example:
56
56
``` js
57
57
import { config } from ' @vue/test-utils'
58
58
59
- config .methods [' errors' ] = () => {
60
- any : () => false
61
- }
59
+ config .methods [' getData' ] = () => {}
62
60
```
63
61
64
62
### ` provide `
Original file line number Diff line number Diff line change @@ -55,9 +55,7 @@ config.mocks['$store'] = {
55
55
``` js
56
56
import { config } from ' @vue/test-utils'
57
57
58
- config .methods [' errors' ] = () => {
59
- any : () => false
60
- }
58
+ config .methods [' getData' ] = () => {}
61
59
```
62
60
63
61
#### ` provide `
Original file line number Diff line number Diff line change @@ -56,9 +56,7 @@ config.mocks['$store'] = {
56
56
``` js
57
57
import { config } from ' @vue/test-utils'
58
58
59
- config .methods [' errors' ] = () => {
60
- any : () => false
61
- }
59
+ config .methods [' getData' ] = () => {}
62
60
```
63
61
64
62
### ` provide `
Original file line number Diff line number Diff line change @@ -56,9 +56,7 @@ config.mocks['$store'] = {
56
56
``` js
57
57
import { config } from ' @vue/test-utils'
58
58
59
- config .methods [' errors' ] = () => {
60
- any : () => false
61
- }
59
+ config .methods [' getData' ] = () => {}
62
60
```
63
61
64
62
### ` provide `
Original file line number Diff line number Diff line change @@ -143,9 +143,9 @@ type ThisTypedShallowMountOptions<V extends Vue> = ShallowMountOptions<V> & This
143
143
144
144
interface VueTestUtilsConfigOptions {
145
145
stubs ?: Record < string , Component | boolean | string >
146
- mocks ?: object
146
+ mocks ?: Record < string , any >
147
147
methods ?: Record < string , Function >
148
- provide ?: object ,
148
+ provide ?: Record < string , any > ,
149
149
logModifiedComponents ?: Boolean
150
150
silent ?: Boolean
151
151
}
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const normalFoo: string = normalWrapper.vm.foo
12
12
const classWrapper = mount ( ClassComponent )
13
13
const classFoo : string = classWrapper . vm . bar
14
14
15
- const functinalWrapper = mount ( functionalOptions )
15
+ const functionalWrapper = mount ( functionalOptions )
16
16
17
17
/**
18
18
* Test for mount options
@@ -83,15 +83,23 @@ config.stubs = {
83
83
qux : `<div>Test</div>` ,
84
84
quux : true
85
85
}
86
+ config . stubs [ 'quuux' ] = true
86
87
config . mocks = {
87
88
foo : 'bar' ,
88
89
}
90
+ config . mocks [ 'foo' ] = {
91
+ bar : 'baz'
92
+ }
89
93
config . methods = {
90
94
foo : ( ) => { }
91
95
}
96
+ config . methods [ 'foo' ] = ( ) => true
92
97
config . provide = {
93
98
foo : { }
94
99
}
100
+ config . provide [ 'foo' ] = {
101
+ bar : { }
102
+ }
95
103
config . logModifiedComponents = true
96
104
config . silent = true
97
105
You can’t perform that action at this time.
0 commit comments