We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi! I doing this vuejs/create-vue#408
type definition not work with Vue 2.7.16
pnpm i
pnpm run type-check
xxxxx@XXXXXX-Air typescript-jsx-pinia-vitest-cypress % pnpm run type-check > [email protected] type-check /Users/baboon/Downloads/create-vue-test/typescript-jsx-pinia-vitest-cypress > vue-tsc --noEmit -p tsconfig.vitest.json --composite false src/components/__tests__/HelloWorld.spec.ts:8:27 - error TS2769: No overload matches this call. The last overload gave the following error. Argument of type 'ComponentPublicInstanceConstructor<Vue3Instance<{}, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{ msg: string; }>>>, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{ msg: string; }>>>, {}, {}, true, ComponentOptionsBase<...>> & ... 4 more ... & Readonly<...>, ... 4 more ..., MethodOptions> & Com...' is not assignable to parameter of type 'ExtendedVue<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<Record<string, any>, Record<string, any>, never, never, ...>>, ... 6 more ..., ComponentOptionsMixin>'. Type 'ComponentPublicInstanceConstructor<Vue3Instance<{}, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{ msg: string; }>>>, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{ msg: string; }>>>, {}, {}, true, ComponentOptionsBase<...>> & ... 4 more ... & Readonly<...>, ... 4 more ..., MethodOptions> & Com...' is missing the following properties from type 'VueConstructor<ExtractComputedReturns<{}> & DefaultProps & Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<...>> & ShallowUnwrapRef<...> & Vue<...>>': extend, nextTick, set, delete, and 10 more. 8 const wrapper = mount(HelloWorld, { propsData: { msg: 'Hello Vitest' } }) ~~~~~~~~~~ node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@vue/test-utils/types/index.d.ts:195:25 195 export declare function mount<V extends Vue, Props = DefaultProps> (component: ExtendedVue<V, {}, {}, {}, Props>, options?: FunctionalComponentMountOptions<V>): Wrapper<CombinedVueInstance<V, {}, {}, {}, Props> & Vue> ~~~~~ The last overload is declared here. Found 1 error in src/components/__tests__/HelloWorld.spec.ts:8 ELIFECYCLE Command failed with exit code 2.
worked
not worked
I try install @vue/[email protected]. but it only work with Vue 3. see vuejs/test-utils#2289
@vue/[email protected]
so, That's why I came here.
The text was updated successfully, but these errors were encountered:
Not an optimal solution, but I was able to work around this by patching the types:
import type { ComponentPublicInstanceConstructor } from 'vue/types/v3-component-public-instance'; ... declare module '@vue/test-utils' { export function mount<T extends ComponentPublicInstanceConstructor>( originalComponent: T, options?: ThisTypedMountOptions<Vue> ): Wrapper<Vue>; }
Sorry, something went wrong.
Not an optimal solution, but I was able to work around this by patching the types: import type { ComponentPublicInstanceConstructor } from 'vue/types/v3-component-public-instance'; ... declare module '@vue/test-utils' { export function mount<T extends ComponentPublicInstanceConstructor>( originalComponent: T, options?: ThisTypedMountOptions<Vue> ): Wrapper<Vue>; }
@mohanyin Thank you, this is a good idea until the repository maintainer fixes the issue. Truth be told, I think you can open a PR. 😇
No branches or pull requests
Subject of the issue
Hi!
I doing this vuejs/create-vue#408
type definition not work with Vue 2.7.16
Steps to reproduce
pnpm i
pnpm run type-check
Expected behaviour
worked
Actual behaviour
not worked
Possible Solution
I try install
@vue/[email protected]
. but it only work with Vue 3. see vuejs/test-utils#2289so, That's why I came here.
The text was updated successfully, but these errors were encountered: