mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-21 01:02:59 +08:00
fix(test-utils): fix type error (#8780)
* fix(test-utils): fix type error * chore: update * chore: update
This commit is contained in:
parent
4b0b051c53
commit
d45c2b95b2
@ -1,4 +1,3 @@
|
||||
// @ts-nocheck
|
||||
import { mount } from '@vue/test-utils'
|
||||
import { merge } from 'lodash'
|
||||
|
||||
@ -9,14 +8,16 @@ const makeMount = <C, O, E>(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 = <T extends Record<string, unknown>>(
|
||||
defaultOptions: T
|
||||
) => {
|
||||
return (template: string, options: Options) => {
|
||||
return mount({
|
||||
...merge({}, defaultOptions, options),
|
||||
|
@ -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!)
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user