Skip to content

Commit b1bae5e

Browse files
committed
fix: patch for @vue/[email protected] with [email protected]
1 parent 4b6358b commit b1bae5e

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Diff for: template/config/typescript/env.d.ts

+13
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
11
/// <reference types="vite/client" />
2+
3+
import type { ComponentPublicInstanceConstructor } from 'vue/types/v3-component-public-instance'
4+
5+
/**
6+
* patch for @vue/[email protected] with [email protected]
7+
* @see https://github.com/vuejs/vue-test-utils/issues/2087#issuecomment-1919820059
8+
*/
9+
declare module '@vue/test-utils' {
10+
export function mount<T extends ComponentPublicInstanceConstructor>(
11+
originalComponent: T,
12+
options?: ThisTypedMountOptions<Vue>
13+
): Wrapper<Vue>
14+
}

Diff for: template/config/vitest/src/components/__tests__/HelloWorld.spec.js

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import HelloWorld from '../HelloWorld.vue'
55

66
describe('HelloWorld', () => {
77
it('renders properly', () => {
8-
// TODO: https://github.com/vuejs/vue-test-utils/issues/2087
9-
// @ts-ignore
108
const wrapper = mount(HelloWorld, { propsData: { msg: 'Hello Vitest' } })
119
expect(wrapper.text()).toContain('Hello Vitest')
1210
})

0 commit comments

Comments
 (0)