Skip to content

Commit c3e013e

Browse files
38elementseddyerburgh
authored andcommittedMay 6, 2018
fix(types): shallow -> shallowMount (#587)
1 parent 290be49 commit c3e013e

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed
 

‎packages/test-utils/types/index.d.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ interface MountOptions<V extends Vue> extends ComponentOptions<V> {
130130

131131
type ThisTypedMountOptions<V extends Vue> = MountOptions<V> & ThisType<V>
132132

133-
type ShallowOptions<V extends Vue> = MountOptions<V>
133+
type ShallowMountOptions<V extends Vue> = MountOptions<V>
134134

135-
type ThisTypedShallowOptions<V extends Vue> = ShallowOptions<V> & ThisType<V>
135+
type ThisTypedShallowMountOptions<V extends Vue> = ShallowMountOptions<V> & ThisType<V>
136136

137137
interface VueTestUtilsConfigOptions {
138138
stubs?: Stubs
@@ -145,9 +145,9 @@ export declare function mount<V extends Vue> (component: VueClass<V>, options?:
145145
export declare function mount<V extends Vue> (component: ComponentOptions<V>, options?: ThisTypedMountOptions<V>): Wrapper<V>
146146
export declare function mount (component: FunctionalComponentOptions, options?: MountOptions<Vue>): Wrapper<Vue>
147147

148-
export declare function shallow<V extends Vue> (component: VueClass<V>, options?: ThisTypedShallowOptions<V>): Wrapper<V>
149-
export declare function shallow<V extends Vue> (component: ComponentOptions<V>, options?: ThisTypedShallowOptions<V>): Wrapper<V>
150-
export declare function shallow (component: FunctionalComponentOptions, options?: ShallowOptions<Vue>): Wrapper<Vue>
148+
export declare function shallowMount<V extends Vue> (component: VueClass<V>, options?: ThisTypedShallowMountOptions<V>): Wrapper<V>
149+
export declare function shallowMount<V extends Vue> (component: ComponentOptions<V>, options?: ThisTypedShallowMountOptions<V>): Wrapper<V>
150+
export declare function shallowMount (component: FunctionalComponentOptions, options?: ShallowMountOptions<Vue>): Wrapper<Vue>
151151

152152
export declare let TransitionStub: Component | string | true
153153
export declare let TransitionGroupStub: Component | string | true

‎packages/test-utils/types/test/shallow.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
import Vuex from 'vuex'
2-
import { shallow, createLocalVue } from '../'
2+
import { shallowMount, createLocalVue } from '../'
33
import { normalOptions, functionalOptions, Normal, ClassComponent } from './resources'
44

55
/**
66
* Should create wrapper vm based on (function) component options or constructors
77
* The users can specify component type via the type parameter
88
*/
9-
const normalWrapper = shallow(normalOptions)
9+
const normalWrapper = shallowMount(normalOptions)
1010
const normalFoo: string = normalWrapper.vm.foo
1111

12-
const classWrapper = shallow(ClassComponent)
12+
const classWrapper = shallowMount(ClassComponent)
1313
const classFoo: string = classWrapper.vm.bar
1414

15-
const functinalWrapper = shallow(functionalOptions)
15+
const functinalWrapper = shallowMount(functionalOptions)
1616

1717
/**
18-
* Test for shallow options
18+
* Test for shallowMount options
1919
*/
2020
const localVue = createLocalVue()
2121
localVue.use(Vuex)
2222

2323
const store = new Vuex.Store({})
2424

25-
shallow(ClassComponent, {
25+
shallowMount(ClassComponent, {
2626
attachToDocument: true,
2727
localVue,
2828
mocks: {
@@ -41,17 +41,17 @@ shallow(ClassComponent, {
4141
}
4242
})
4343

44-
shallow(functionalOptions, {
44+
shallowMount(functionalOptions, {
4545
context: {
4646
props: { foo: 'test' }
4747
},
4848
stubs: ['child']
4949
})
5050

5151
/**
52-
* ShallowOptions should receive Vue's component options
52+
* ShallowMountOptions should receive Vue's component options
5353
*/
54-
shallow(ClassComponent, {
54+
shallowMount(ClassComponent, {
5555
propsData: {
5656
test: 'test'
5757
},

0 commit comments

Comments
 (0)
Please sign in to comment.