chore: fix types

This commit is contained in:
Evan You 2023-02-02 15:27:29 +08:00
parent 45984d559f
commit c1cbb747b5
3 changed files with 7 additions and 5 deletions

View File

@ -3026,7 +3026,7 @@ foo
]
}
for (const key of Object.keys(patterns) as (keyof typeof patterns)[]) {
for (const key of Object.keys(patterns)) {
describe(key, () => {
for (const { code, errors, options } of patterns[key]) {
test(

View File

@ -325,7 +325,8 @@ describe('api: defineAsyncComponent', () => {
render: () => h(Foo)
})
const handler = (app.config.errorHandler = vi.fn())
const handler = vi.fn()
app.config.errorHandler = handler
app.mount(root)
expect(serializeInner(root)).toBe('<!---->')
@ -422,7 +423,8 @@ describe('api: defineAsyncComponent', () => {
const app = createApp({
render: () => h(Foo)
})
const handler = (app.config.errorHandler = vi.fn())
const handler = vi.fn()
app.config.errorHandler = handler
app.mount(root)
expect(serializeInner(root)).toBe('<!---->')
await timeout(1)

View File

@ -1,8 +1,8 @@
import { vi } from 'vitest'
import { vi, SpyInstance } from 'vitest'
import { render, h } from '@vue/runtime-dom'
describe('customized built-in elements support', () => {
let createElement: vi.SpyInstance
let createElement: SpyInstance
afterEach(() => {
createElement.mockRestore()
})