mirror of
https://github.com/vitest-dev/vitest.git
synced 2025-12-08 18:26:03 +00:00
25 lines
824 B
TypeScript
25 lines
824 B
TypeScript
import type { Locator } from '@vitest/browser/context'
|
|
import type jsdomMatchers from './jest-dom.js'
|
|
import type { Assertion, ExpectPollOptions } from 'vitest'
|
|
|
|
declare module 'vitest' {
|
|
interface JestAssertion<T = any> extends jsdomMatchers.default.TestingLibraryMatchers<void, T> {}
|
|
interface AsymmetricMatchersContaining extends jsdomMatchers.default.TestingLibraryMatchers<void, void> {}
|
|
|
|
type Promisify<O> = {
|
|
[K in keyof O]: O[K] extends (...args: infer A) => infer R
|
|
? O extends R
|
|
? Promisify<O[K]>
|
|
: (...args: A) => Promise<R>
|
|
: O[K];
|
|
}
|
|
|
|
type PromisifyDomAssertion<T> = Promisify<Assertion<T>>
|
|
|
|
interface ExpectStatic {
|
|
element: <T extends Element | Locator>(element: T, options?: ExpectPollOptions) => PromisifyDomAssertion<Awaited<Element | null>>
|
|
}
|
|
}
|
|
|
|
export {}
|