From c3e013e689570dc407a416aaa1344b390aa04aa1 Mon Sep 17 00:00:00 2001 From: 38elements <38elements@users.noreply.github.com> Date: Sun, 6 May 2018 19:12:06 +0900 Subject: [PATCH] fix(types): shallow -> shallowMount (#587) --- packages/test-utils/types/index.d.ts | 10 +++++----- packages/test-utils/types/test/shallow.ts | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/test-utils/types/index.d.ts b/packages/test-utils/types/index.d.ts index 148029561..5d1f4f48e 100644 --- a/packages/test-utils/types/index.d.ts +++ b/packages/test-utils/types/index.d.ts @@ -130,9 +130,9 @@ interface MountOptions extends ComponentOptions { type ThisTypedMountOptions = MountOptions & ThisType -type ShallowOptions = MountOptions +type ShallowMountOptions = MountOptions -type ThisTypedShallowOptions = ShallowOptions & ThisType +type ThisTypedShallowMountOptions = ShallowMountOptions & ThisType interface VueTestUtilsConfigOptions { stubs?: Stubs @@ -145,9 +145,9 @@ export declare function mount (component: VueClass, options?: export declare function mount (component: ComponentOptions, options?: ThisTypedMountOptions): Wrapper export declare function mount (component: FunctionalComponentOptions, options?: MountOptions): Wrapper -export declare function shallow (component: VueClass, options?: ThisTypedShallowOptions): Wrapper -export declare function shallow (component: ComponentOptions, options?: ThisTypedShallowOptions): Wrapper -export declare function shallow (component: FunctionalComponentOptions, options?: ShallowOptions): Wrapper +export declare function shallowMount (component: VueClass, options?: ThisTypedShallowMountOptions): Wrapper +export declare function shallowMount (component: ComponentOptions, options?: ThisTypedShallowMountOptions): Wrapper +export declare function shallowMount (component: FunctionalComponentOptions, options?: ShallowMountOptions): Wrapper export declare let TransitionStub: Component | string | true export declare let TransitionGroupStub: Component | string | true diff --git a/packages/test-utils/types/test/shallow.ts b/packages/test-utils/types/test/shallow.ts index 1463a56eb..3a5ee2a5a 100644 --- a/packages/test-utils/types/test/shallow.ts +++ b/packages/test-utils/types/test/shallow.ts @@ -1,28 +1,28 @@ import Vuex from 'vuex' -import { shallow, createLocalVue } from '../' +import { shallowMount, createLocalVue } from '../' import { normalOptions, functionalOptions, Normal, ClassComponent } from './resources' /** * Should create wrapper vm based on (function) component options or constructors * The users can specify component type via the type parameter */ -const normalWrapper = shallow(normalOptions) +const normalWrapper = shallowMount(normalOptions) const normalFoo: string = normalWrapper.vm.foo -const classWrapper = shallow(ClassComponent) +const classWrapper = shallowMount(ClassComponent) const classFoo: string = classWrapper.vm.bar -const functinalWrapper = shallow(functionalOptions) +const functinalWrapper = shallowMount(functionalOptions) /** - * Test for shallow options + * Test for shallowMount options */ const localVue = createLocalVue() localVue.use(Vuex) const store = new Vuex.Store({}) -shallow(ClassComponent, { +shallowMount(ClassComponent, { attachToDocument: true, localVue, mocks: { @@ -41,7 +41,7 @@ shallow(ClassComponent, { } }) -shallow(functionalOptions, { +shallowMount(functionalOptions, { context: { props: { foo: 'test' } }, @@ -49,9 +49,9 @@ shallow(functionalOptions, { }) /** - * ShallowOptions should receive Vue's component options + * ShallowMountOptions should receive Vue's component options */ -shallow(ClassComponent, { +shallowMount(ClassComponent, { propsData: { test: 'test' },