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:
5656``` js
5757import { config } from ' @vue/test-utils'
5858
59- config .methods [' errors' ] = () => {
60- any : () => false
61- }
59+ config .methods [' getData' ] = () => {}
6260```
6361
6462### ` provide `
Original file line number Diff line number Diff line change @@ -55,9 +55,7 @@ config.mocks['$store'] = {
5555``` js
5656import { config } from ' @vue/test-utils'
5757
58- config .methods [' errors' ] = () => {
59- any : () => false
60- }
58+ config .methods [' getData' ] = () => {}
6159```
6260
6361#### ` provide `
Original file line number Diff line number Diff line change @@ -56,9 +56,7 @@ config.mocks['$store'] = {
5656``` js
5757import { config } from ' @vue/test-utils'
5858
59- config .methods [' errors' ] = () => {
60- any : () => false
61- }
59+ config .methods [' getData' ] = () => {}
6260```
6361
6462### ` provide `
Original file line number Diff line number Diff line change @@ -56,9 +56,7 @@ config.mocks['$store'] = {
5656``` js
5757import { config } from ' @vue/test-utils'
5858
59- config .methods [' errors' ] = () => {
60- any : () => false
61- }
59+ config .methods [' getData' ] = () => {}
6260```
6361
6462### ` provide `
Original file line number Diff line number Diff line change @@ -143,9 +143,9 @@ type ThisTypedShallowMountOptions<V extends Vue> = ShallowMountOptions<V> & This
143143
144144interface VueTestUtilsConfigOptions {
145145 stubs ?: Record < string , Component | boolean | string >
146- mocks ?: object
146+ mocks ?: Record < string , any >
147147 methods ?: Record < string , Function >
148- provide ?: object ,
148+ provide ?: Record < string , any > ,
149149 logModifiedComponents ?: Boolean
150150 silent ?: Boolean
151151}
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const normalFoo: string = normalWrapper.vm.foo
1212const classWrapper = mount ( ClassComponent )
1313const classFoo : string = classWrapper . vm . bar
1414
15- const functinalWrapper = mount ( functionalOptions )
15+ const functionalWrapper = mount ( functionalOptions )
1616
1717/**
1818 * Test for mount options
@@ -83,15 +83,23 @@ config.stubs = {
8383 qux : `<div>Test</div>` ,
8484 quux : true
8585}
86+ config . stubs [ 'quuux' ] = true
8687config . mocks = {
8788 foo : 'bar' ,
8889}
90+ config . mocks [ 'foo' ] = {
91+ bar : 'baz'
92+ }
8993config . methods = {
9094 foo : ( ) => { }
9195}
96+ config . methods [ 'foo' ] = ( ) => true
9297config . provide = {
9398 foo : { }
9499}
100+ config . provide [ 'foo' ] = {
101+ bar : { }
102+ }
95103config . logModifiedComponents = true
96104config . silent = true
97105
You can’t perform that action at this time.
0 commit comments