From d45c2b95b254c944f8671bfd2f96fe82ead125e3 Mon Sep 17 00:00:00 2001 From: zz <2418184580@qq.com> Date: Sat, 16 Jul 2022 21:01:48 +0800 Subject: [PATCH] fix(test-utils): fix type error (#8780) * fix(test-utils): fix type error * chore: update * chore: update --- packages/test-utils/make-mount.ts | 9 +++++---- packages/test-utils/mock.ts | 3 +-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/test-utils/make-mount.ts b/packages/test-utils/make-mount.ts index a13b29b5e5..b3632c3dab 100644 --- a/packages/test-utils/make-mount.ts +++ b/packages/test-utils/make-mount.ts @@ -1,4 +1,3 @@ -// @ts-nocheck import { mount } from '@vue/test-utils' import { merge } from 'lodash' @@ -9,14 +8,16 @@ const makeMount = (element: C, defaultOptions: O) => { interface Options { data?: () => { - [key: string]: any + [key: string]: unknown } methods?: { - [key: string]: (...args) => any + [key: string]: (...args: unknown[]) => any } } -export const makeMountFunc = (defaultOptions) => { +export const makeMountFunc = >( + defaultOptions: T +) => { return (template: string, options: Options) => { return mount({ ...merge({}, defaultOptions, options), diff --git a/packages/test-utils/mock.ts b/packages/test-utils/mock.ts index f444895ecb..ef75db6676 100644 --- a/packages/test-utils/mock.ts +++ b/packages/test-utils/mock.ts @@ -1,4 +1,3 @@ -// @ts-nocheck import { nextTick } from 'vue' import { afterAll, beforeAll } from 'vitest' @@ -20,6 +19,6 @@ export function mockImageEvent() { }) }) afterAll(() => { - Object.defineProperty(imageProto, 'src', oldDescriptor) + Object.defineProperty(imageProto, 'src', oldDescriptor!) }) }