mirror of https://github.com/vuejs/core.git
chore: move custom matcher types to setup-vitest.ts (#11252)
This commit is contained in:
parent
2f11a455e0
commit
ae97e50538
|
@ -19,15 +19,6 @@ declare var __FEATURE_PROD_DEVTOOLS__: boolean
|
|||
declare var __FEATURE_SUSPENSE__: boolean
|
||||
declare var __FEATURE_PROD_HYDRATION_MISMATCH_DETAILS__: boolean
|
||||
|
||||
// for tests
|
||||
declare namespace jest {
|
||||
interface Matchers<R, T> {
|
||||
toHaveBeenWarned(): R
|
||||
toHaveBeenWarnedLast(): R
|
||||
toHaveBeenWarnedTimes(n: number): R
|
||||
}
|
||||
}
|
||||
|
||||
declare module '*.vue' {}
|
||||
|
||||
declare module 'file-saver' {
|
||||
|
|
|
@ -1,5 +1,16 @@
|
|||
import type { MockInstance } from 'vitest'
|
||||
|
||||
declare module 'vitest' {
|
||||
interface Assertion<T = any> extends CustomMatchers<T> {}
|
||||
interface AsymmetricMatchersContaining extends CustomMatchers {}
|
||||
}
|
||||
|
||||
interface CustomMatchers<R = unknown> {
|
||||
toHaveBeenWarned(): R
|
||||
toHaveBeenWarnedLast(): R
|
||||
toHaveBeenWarnedTimes(n: number): R
|
||||
}
|
||||
|
||||
vi.stubGlobal('MathMLElement', class MathMLElement {})
|
||||
|
||||
expect.extend({
|
||||
|
|
Loading…
Reference in New Issue