diff --git a/packages/vitest/src/index.ts b/packages/vitest/src/index.ts index 0c0e68d1dbe8..0801dd93bc38 100644 --- a/packages/vitest/src/index.ts +++ b/packages/vitest/src/index.ts @@ -41,6 +41,12 @@ type Promisify = { } declare global { + // support augmenting jest.Matchers by other libraries + namespace jest { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + interface Matchers {} + } + namespace Vi { interface ExpectStatic extends Chai.ExpectStatic, AsymmetricMatchersContaining { (actual: T, message?: string): Vi.Assertion @@ -56,7 +62,7 @@ declare global { not: AsymmetricMatchersContaining } - interface JestAssertion { + interface JestAssertion extends jest.Matchers { // Snapshot toMatchSnapshot(snapshot: Partial, message?: string): void toMatchSnapshot(message?: string): void