Skip to content

Commit cf3afe2

Browse files
authoredMay 3, 2023
feat!: move assertion declarations to expect package (#3294)
1 parent 1f1189b commit cf3afe2

File tree

13 files changed

+162
-153
lines changed

13 files changed

+162
-153
lines changed
 

Diff for: ‎.eslintrc

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"no-only-tests/no-only-tests": "off",
55
// prefer global Buffer to not initialize the whole module
66
"n/prefer-global/buffer": "off",
7+
"@typescript-eslint/no-invalid-this": "off",
78
"no-restricted-imports": [
89
"error",
910
{

Diff for: ‎docs/api/expect.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -1290,18 +1290,16 @@ If the value in the error message is too truncated, you can increase [chaiConfig
12901290

12911291
This function is compatible with Jest's `expect.extend`, so any library that uses it to create custom matchers will work with Vitest.
12921292

1293-
If you are using TypeScript, you can extend default `Matchers` interface in an ambient declaration file (e.g: `vitest.d.ts`) with the code below:
1293+
If you are using TypeScript, since Vitest 0.31.0 you can extend default `Assertion` interface in an ambient declaration file (e.g: `vitest.d.ts`) with the code below:
12941294

12951295
```ts
12961296
interface CustomMatchers<R = unknown> {
12971297
toBeFoo(): R
12981298
}
12991299

1300-
declare namespace Vi {
1301-
interface Assertion extends CustomMatchers {}
1300+
declare module '@vitest/expect' {
1301+
interface Assertion<T = any> extends CustomMatchers<T> {}
13021302
interface AsymmetricMatchersContaining extends CustomMatchers {}
1303-
1304-
// Note: augmenting jest.Matchers interface will also work.
13051303
}
13061304
```
13071305

Diff for: ‎docs/guide/extending-matchers.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,16 @@ expect.extend({
2323
})
2424
```
2525

26-
If you are using TypeScript, you can extend default Matchers interface in an ambient declaration file (e.g: `vitest.d.ts`) with the code below:
26+
If you are using TypeScript, since Vitest 0.31.0 you can extend default `Assertion` interface in an ambient declaration file (e.g: `vitest.d.ts`) with the code below:
2727

2828
```ts
2929
interface CustomMatchers<R = unknown> {
3030
toBeFoo(): R
3131
}
3232

33-
declare namespace Vi {
34-
interface Assertion extends CustomMatchers {}
33+
declare module '@vitest/expect' {
34+
interface Assertion<T = any> extends CustomMatchers<T> {}
3535
interface AsymmetricMatchersContaining extends CustomMatchers {}
36-
37-
// Note: augmenting jest.Matchers interface will also work.
3836
}
3937
```
4038

Diff for: ‎packages/expect/src/jest-asymmetric-matchers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export abstract class AsymmetricMatcher<
2121

2222
constructor(protected sample: T, protected inverse = false) {}
2323

24-
protected getMatcherContext(expect?: Vi.ExpectStatic): State {
24+
protected getMatcherContext(expect?: Chai.ExpectStatic): State {
2525
return {
2626
...getState(expect || (globalThis as any)[GLOBAL_EXPECT]),
2727
equals,

Diff for: ‎packages/expect/src/jest-expect.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { assertTypes, getColors } from '@vitest/utils'
33
import type { Constructable } from '@vitest/utils'
44
import type { EnhancedSpy } from '@vitest/spy'
55
import { isMockFunction } from '@vitest/spy'
6-
import type { ChaiPlugin } from './types'
6+
import type { Assertion, ChaiPlugin } from './types'
77
import { arrayBufferEquality, generateToBeMessage, iterableEquality, equals as jestEquals, sparseArrayEquality, subsetEquality, typeEquality } from './jest-utils'
88
import type { AsymmetricMatcher } from './jest-asymmetric-matchers'
99
import { diff, stringify } from './jest-matcher-utils'
@@ -14,8 +14,8 @@ import { recordAsyncExpect } from './utils'
1414
export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
1515
const c = () => getColors()
1616

17-
function def(name: keyof Vi.Assertion | (keyof Vi.Assertion)[], fn: ((this: Chai.AssertionStatic & Vi.Assertion, ...args: any[]) => any)) {
18-
const addMethod = (n: keyof Vi.Assertion) => {
17+
function def(name: keyof Assertion | (keyof Assertion)[], fn: ((this: Chai.AssertionStatic & Assertion, ...args: any[]) => any)) {
18+
const addMethod = (n: keyof Assertion) => {
1919
utils.addMethod(chai.Assertion.prototype, n, fn)
2020
utils.addMethod((globalThis as any)[JEST_MATCHERS_OBJECT].matchers, n, fn)
2121
}

Diff for: ‎packages/expect/src/jest-extend.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { util } from 'chai'
22
import type {
33
ChaiPlugin,
4+
ExpectStatic,
45
MatcherState,
56
MatchersObject,
67
SyncExpectationResult,
@@ -17,7 +18,7 @@ import {
1718
subsetEquality,
1819
} from './jest-utils'
1920

20-
function getMatcherState(assertion: Chai.AssertionStatic & Chai.Assertion, expect: Vi.ExpectStatic) {
21+
function getMatcherState(assertion: Chai.AssertionStatic & Chai.Assertion, expect: ExpectStatic) {
2122
const obj = assertion._obj
2223
const isNot = util.flag(assertion, 'negate') as boolean
2324
const promise = util.flag(assertion, 'promise') || ''
@@ -52,7 +53,7 @@ class JestExtendError extends Error {
5253
}
5354
}
5455

55-
function JestExtendPlugin(expect: Vi.ExpectStatic, matchers: MatchersObject): ChaiPlugin {
56+
function JestExtendPlugin(expect: ExpectStatic, matchers: MatchersObject): ChaiPlugin {
5657
return (c, utils) => {
5758
Object.entries(matchers).forEach(([expectAssertionName, expectAssertion]) => {
5859
function expectWrapper(this: Chai.AssertionStatic & Chai.Assertion, ...args: any[]) {
@@ -123,7 +124,7 @@ function JestExtendPlugin(expect: Vi.ExpectStatic, matchers: MatchersObject): Ch
123124
}
124125

125126
export const JestExtend: ChaiPlugin = (chai, utils) => {
126-
utils.addMethod(chai.expect, 'extend', (expect: Vi.ExpectStatic, expects: MatchersObject) => {
127+
utils.addMethod(chai.expect, 'extend', (expect: ExpectStatic, expects: MatchersObject) => {
127128
chai.use(JestExtendPlugin(expect, expects))
128129
})
129130
}

Diff for: ‎packages/expect/src/state.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import type { MatcherState } from './types'
1+
import type { ExpectStatic, MatcherState } from './types'
22
import { GLOBAL_EXPECT, JEST_MATCHERS_OBJECT, MATCHERS_OBJECT } from './constants'
33

44
if (!Object.prototype.hasOwnProperty.call(globalThis, MATCHERS_OBJECT)) {
5-
const globalState = new WeakMap<Vi.ExpectStatic, MatcherState>()
5+
const globalState = new WeakMap<ExpectStatic, MatcherState>()
66
const matchers = Object.create(null)
77
Object.defineProperty(globalThis, MATCHERS_OBJECT, {
88
get: () => globalState,
@@ -16,13 +16,13 @@ if (!Object.prototype.hasOwnProperty.call(globalThis, MATCHERS_OBJECT)) {
1616
})
1717
}
1818

19-
export function getState<State extends MatcherState = MatcherState>(expect: Vi.ExpectStatic): State {
19+
export function getState<State extends MatcherState = MatcherState>(expect: ExpectStatic): State {
2020
return (globalThis as any)[MATCHERS_OBJECT].get(expect)
2121
}
2222

2323
export function setState<State extends MatcherState = MatcherState>(
2424
state: Partial<State>,
25-
expect: Vi.ExpectStatic,
25+
expect: ExpectStatic,
2626
): void {
2727
const map = (globalThis as any)[MATCHERS_OBJECT]
2828
const current = map.get(expect) || {}

Diff for: ‎packages/expect/src/types.ts

+104
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import type { use as chaiUse } from 'chai'
99
*/
1010

1111
import type { Formatter } from 'picocolors/types'
12+
import type { Constructable } from '@vitest/utils'
1213
import type { diff, getMatcherUtils, stringify } from './jest-matcher-utils'
1314

1415
export type FirstFunctionArgument<T> = T extends (arg: infer A) => unknown ? A : never
@@ -96,3 +97,106 @@ export interface RawMatcherFn<T extends MatcherState = MatcherState> {
9697
}
9798

9899
export type MatchersObject<T extends MatcherState = MatcherState> = Record<string, RawMatcherFn<T>>
100+
101+
export interface ExpectStatic extends Chai.ExpectStatic, AsymmetricMatchersContaining {
102+
<T>(actual: T, message?: string): Assertion<T>
103+
104+
extend(expects: MatchersObject): void
105+
assertions(expected: number): void
106+
hasAssertions(): void
107+
anything(): any
108+
any(constructor: unknown): any
109+
getState(): MatcherState
110+
setState(state: Partial<MatcherState>): void
111+
not: AsymmetricMatchersContaining
112+
}
113+
114+
export interface AsymmetricMatchersContaining {
115+
stringContaining(expected: string): any
116+
objectContaining<T = any>(expected: T): any
117+
arrayContaining<T = unknown>(expected: Array<T>): any
118+
stringMatching(expected: string | RegExp): any
119+
}
120+
121+
export interface JestAssertion<T = any> extends jest.Matchers<void, T> {
122+
// Jest compact
123+
toEqual<E>(expected: E): void
124+
toStrictEqual<E>(expected: E): void
125+
toBe<E>(expected: E): void
126+
toMatch(expected: string | RegExp): void
127+
toMatchObject<E extends {} | any[]>(expected: E): void
128+
toContain<E>(item: E): void
129+
toContainEqual<E>(item: E): void
130+
toBeTruthy(): void
131+
toBeFalsy(): void
132+
toBeGreaterThan(num: number | bigint): void
133+
toBeGreaterThanOrEqual(num: number | bigint): void
134+
toBeLessThan(num: number | bigint): void
135+
toBeLessThanOrEqual(num: number | bigint): void
136+
toBeNaN(): void
137+
toBeUndefined(): void
138+
toBeNull(): void
139+
toBeDefined(): void
140+
toBeInstanceOf<E>(expected: E): void
141+
toBeCalledTimes(times: number): void
142+
toHaveLength(length: number): void
143+
toHaveProperty<E>(property: string | (string | number)[], value?: E): void
144+
toBeCloseTo(number: number, numDigits?: number): void
145+
toHaveBeenCalledTimes(times: number): void
146+
toHaveBeenCalled(): void
147+
toBeCalled(): void
148+
toHaveBeenCalledWith<E extends any[]>(...args: E): void
149+
toBeCalledWith<E extends any[]>(...args: E): void
150+
toHaveBeenNthCalledWith<E extends any[]>(n: number, ...args: E): void
151+
nthCalledWith<E extends any[]>(nthCall: number, ...args: E): void
152+
toHaveBeenLastCalledWith<E extends any[]>(...args: E): void
153+
lastCalledWith<E extends any[]>(...args: E): void
154+
toThrow(expected?: string | Constructable | RegExp | Error): void
155+
toThrowError(expected?: string | Constructable | RegExp | Error): void
156+
toReturn(): void
157+
toHaveReturned(): void
158+
toReturnTimes(times: number): void
159+
toHaveReturnedTimes(times: number): void
160+
toReturnWith<E>(value: E): void
161+
toHaveReturnedWith<E>(value: E): void
162+
toHaveLastReturnedWith<E>(value: E): void
163+
lastReturnedWith<E>(value: E): void
164+
toHaveNthReturnedWith<E>(nthCall: number, value: E): void
165+
nthReturnedWith<E>(nthCall: number, value: E): void
166+
}
167+
168+
type VitestAssertion<A, T> = {
169+
[K in keyof A]: A[K] extends Chai.Assertion
170+
? Assertion<T>
171+
: A[K] extends (...args: any[]) => any
172+
? A[K] // not converting function since they may contain overload
173+
: VitestAssertion<A[K], T>
174+
} & ((type: string, message?: string) => Assertion)
175+
176+
type Promisify<O> = {
177+
[K in keyof O]: O[K] extends (...args: infer A) => infer R
178+
? O extends R
179+
? Promisify<O[K]>
180+
: (...args: A) => Promise<R>
181+
: O[K]
182+
}
183+
184+
export interface Assertion<T = any> extends VitestAssertion<Chai.Assertion, T>, JestAssertion<T> {
185+
toBeTypeOf(expected: 'bigint' | 'boolean' | 'function' | 'number' | 'object' | 'string' | 'symbol' | 'undefined'): void
186+
toHaveBeenCalledOnce(): void
187+
toSatisfy<E>(matcher: (value: E) => boolean, message?: string): void
188+
189+
resolves: Promisify<Assertion<T>>
190+
rejects: Promisify<Assertion<T>>
191+
}
192+
193+
declare global {
194+
// support augmenting jest.Matchers by other libraries
195+
namespace jest {
196+
197+
// eslint-disable-next-line unused-imports/no-unused-vars
198+
interface Matchers<R, T = {}> {}
199+
}
200+
}
201+
202+
export {}

Diff for: ‎packages/vitest/src/integrations/chai/index.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,22 @@ import './setup'
55
import type { Test } from '@vitest/runner'
66
import { getCurrentTest } from '@vitest/runner'
77
import { GLOBAL_EXPECT, getState, setState } from '@vitest/expect'
8+
import type { Assertion, ExpectStatic } from '@vitest/expect'
89
import type { MatcherState } from '../../types/chai'
910
import { getCurrentEnvironment, getFullName } from '../../utils'
1011

1112
export function createExpect(test?: Test) {
12-
const expect = ((value: any, message?: string): Vi.Assertion => {
13+
const expect = ((value: any, message?: string): Assertion => {
1314
const { assertionCalls } = getState(expect)
1415
setState({ assertionCalls: assertionCalls + 1 }, expect)
15-
const assert = chai.expect(value, message) as unknown as Vi.Assertion
16+
const assert = chai.expect(value, message) as unknown as Assertion
1617
const _test = test || getCurrentTest()
1718
if (_test)
1819
// @ts-expect-error internal
19-
return assert.withTest(_test) as Vi.Assertion
20+
return assert.withTest(_test) as Assertion
2021
else
2122
return assert
22-
}) as Vi.ExpectStatic
23+
}) as ExpectStatic
2324
Object.assign(expect, chai.expect)
2425

2526
expect.getState = () => getState<MatcherState>(expect)

Diff for: ‎packages/vitest/src/runtime/runners/test.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { CancelReason, Suite, Test, TestContext, VitestRunner, VitestRunnerImportSource } from '@vitest/runner'
2+
import type { ExpectStatic } from '@vitest/expect'
23
import { GLOBAL_EXPECT, getState, setState } from '@vitest/expect'
34
import { getSnapshotClient } from '../../integrations/snapshot/chai'
45
import { vi } from '../../integrations/vi'
@@ -103,7 +104,7 @@ export class VitestTestRunner implements VitestRunner {
103104
}
104105

105106
extendTestContext(context: TestContext): TestContext {
106-
let _expect: Vi.ExpectStatic | undefined
107+
let _expect: ExpectStatic | undefined
107108
Object.defineProperty(context, 'expect', {
108109
get() {
109110
if (!_expect)

Diff for: ‎packages/vitest/src/types/global.ts

+20-122
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,37 @@
11
import type { Plugin as PrettyFormatPlugin } from 'pretty-format'
2-
import type { MatchersObject } from '@vitest/expect'
32
import type { SnapshotState } from '@vitest/snapshot'
4-
import type { MatcherState } from './chai'
5-
import type { Constructable, UserConsoleLog } from './general'
3+
import type { ExpectStatic } from '@vitest/expect'
4+
import type { UserConsoleLog } from './general'
65
import type { VitestEnvironment } from './config'
76
import type { BenchmarkResult } from './benchmark'
87

9-
type Promisify<O> = {
10-
[K in keyof O]: O[K] extends (...args: infer A) => infer R
11-
? O extends R
12-
? Promisify<O[K]>
13-
: (...args: A) => Promise<R>
14-
: O[K]
15-
}
16-
178
declare module '@vitest/expect' {
189
interface MatcherState {
1910
environment: VitestEnvironment
2011
snapshotState: SnapshotState
2112
}
13+
14+
interface ExpectStatic {
15+
addSnapshotSerializer(plugin: PrettyFormatPlugin): void
16+
}
17+
18+
interface Assertion<T> {
19+
// Snapshots are extended in @vitest/snapshot and are not part of @vitest/expect
20+
matchSnapshot<U extends { [P in keyof T]: any }>(snapshot: Partial<U>, message?: string): void
21+
matchSnapshot(message?: string): void
22+
toMatchSnapshot<U extends { [P in keyof T]: any }>(snapshot: Partial<U>, message?: string): void
23+
toMatchSnapshot(message?: string): void
24+
toMatchInlineSnapshot<U extends { [P in keyof T]: any }>(properties: Partial<U>, snapshot?: string, message?: string): void
25+
toMatchInlineSnapshot(snapshot?: string, message?: string): void
26+
toThrowErrorMatchingSnapshot(message?: string): void
27+
toThrowErrorMatchingInlineSnapshot(snapshot?: string, message?: string): void
28+
toMatchFileSnapshot(filepath: string, message?: string): Promise<void>
29+
}
2230
}
2331

2432
declare module '@vitest/runner' {
2533
interface TestContext {
26-
expect: Vi.ExpectStatic
34+
expect: ExpectStatic
2735
}
2836

2937
interface File {
@@ -39,113 +47,3 @@ declare module '@vitest/runner' {
3947
benchmark?: BenchmarkResult
4048
}
4149
}
42-
43-
declare global {
44-
// support augmenting jest.Matchers by other libraries
45-
namespace jest {
46-
47-
// eslint-disable-next-line unused-imports/no-unused-vars
48-
interface Matchers<R, T = {}> {}
49-
}
50-
51-
namespace Vi {
52-
interface ExpectStatic extends Chai.ExpectStatic, AsymmetricMatchersContaining {
53-
<T>(actual: T, message?: string): Vi.Assertion<T>
54-
55-
extend(expects: MatchersObject): void
56-
assertions(expected: number): void
57-
hasAssertions(): void
58-
anything(): any
59-
any(constructor: unknown): any
60-
addSnapshotSerializer(plugin: PrettyFormatPlugin): void
61-
getState(): MatcherState
62-
setState(state: Partial<MatcherState>): void
63-
not: AsymmetricMatchersContaining
64-
}
65-
66-
interface AsymmetricMatchersContaining {
67-
stringContaining(expected: string): any
68-
objectContaining<T = any>(expected: T): any
69-
arrayContaining<T = unknown>(expected: Array<T>): any
70-
stringMatching(expected: string | RegExp): any
71-
}
72-
73-
interface JestAssertion<T = any> extends jest.Matchers<void, T> {
74-
// Snapshot
75-
matchSnapshot<U extends { [P in keyof T]: any }>(snapshot: Partial<U>, message?: string): void
76-
matchSnapshot(message?: string): void
77-
toMatchSnapshot<U extends { [P in keyof T]: any }>(snapshot: Partial<U>, message?: string): void
78-
toMatchSnapshot(message?: string): void
79-
toMatchInlineSnapshot<U extends { [P in keyof T]: any }>(properties: Partial<U>, snapshot?: string, message?: string): void
80-
toMatchInlineSnapshot(snapshot?: string, message?: string): void
81-
toMatchFileSnapshot(filepath: string, message?: string): Promise<void>
82-
toThrowErrorMatchingSnapshot(message?: string): void
83-
toThrowErrorMatchingInlineSnapshot(snapshot?: string, message?: string): void
84-
85-
// Jest compact
86-
toEqual<E>(expected: E): void
87-
toStrictEqual<E>(expected: E): void
88-
toBe<E>(expected: E): void
89-
toMatch(expected: string | RegExp): void
90-
toMatchObject<E extends {} | any[]>(expected: E): void
91-
toContain<E>(item: E): void
92-
toContainEqual<E>(item: E): void
93-
toBeTruthy(): void
94-
toBeFalsy(): void
95-
toBeGreaterThan(num: number | bigint): void
96-
toBeGreaterThanOrEqual(num: number | bigint): void
97-
toBeLessThan(num: number | bigint): void
98-
toBeLessThanOrEqual(num: number | bigint): void
99-
toBeNaN(): void
100-
toBeUndefined(): void
101-
toBeNull(): void
102-
toBeDefined(): void
103-
toBeTypeOf(expected: 'bigint' | 'boolean' | 'function' | 'number' | 'object' | 'string' | 'symbol' | 'undefined'): void
104-
toBeInstanceOf<E>(expected: E): void
105-
toBeCalledTimes(times: number): void
106-
toHaveLength(length: number): void
107-
toHaveProperty<E>(property: string | (string | number)[], value?: E): void
108-
toBeCloseTo(number: number, numDigits?: number): void
109-
toHaveBeenCalledTimes(times: number): void
110-
toHaveBeenCalledOnce(): void
111-
toHaveBeenCalled(): void
112-
toBeCalled(): void
113-
toHaveBeenCalledWith<E extends any[]>(...args: E): void
114-
toBeCalledWith<E extends any[]>(...args: E): void
115-
toHaveBeenNthCalledWith<E extends any[]>(n: number, ...args: E): void
116-
nthCalledWith<E extends any[]>(nthCall: number, ...args: E): void
117-
toHaveBeenLastCalledWith<E extends any[]>(...args: E): void
118-
lastCalledWith<E extends any[]>(...args: E): void
119-
toThrow(expected?: string | Constructable | RegExp | Error): void
120-
toThrowError(expected?: string | Constructable | RegExp | Error): void
121-
toReturn(): void
122-
toHaveReturned(): void
123-
toReturnTimes(times: number): void
124-
toHaveReturnedTimes(times: number): void
125-
toReturnWith<E>(value: E): void
126-
toHaveReturnedWith<E>(value: E): void
127-
toHaveLastReturnedWith<E>(value: E): void
128-
lastReturnedWith<E>(value: E): void
129-
toHaveNthReturnedWith<E>(nthCall: number, value: E): void
130-
nthReturnedWith<E>(nthCall: number, value: E): void
131-
toSatisfy<E>(matcher: (value: E) => boolean, message?: string): void
132-
}
133-
134-
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
135-
// @ts-ignore build namespace conflict
136-
type VitestAssertion<A, T> = {
137-
[K in keyof A]: A[K] extends Chai.Assertion
138-
? Assertion<T>
139-
: A[K] extends (...args: any[]) => any
140-
? A[K] // not converting function since they may contain overload
141-
: VitestAssertion<A[K], T>
142-
} & ((type: string, message?: string) => Assertion)
143-
144-
interface Assertion<T = any> extends VitestAssertion<Chai.Assertion, T>, JestAssertion<T> {
145-
resolves: Promisify<Assertion<T>>
146-
rejects: Promisify<Assertion<T>>
147-
}
148-
}
149-
}
150-
151-
export {}

Diff for: ‎packages/vitest/src/types/index.ts

+7
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,10 @@ export type {
2424
Mocked,
2525
MockedClass,
2626
} from '../integrations/spy'
27+
28+
export type {
29+
ExpectStatic,
30+
AsymmetricMatchersContaining,
31+
JestAssertion,
32+
Assertion,
33+
} from '@vitest/expect'

Diff for: ‎test/core/test/jest-expect.test.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ interface CustomMatchers<R = unknown> {
1313
toBeTestedPromise(): R
1414
}
1515

16+
declare module '@vitest/expect' {
17+
interface Assertion<T = any> extends CustomMatchers<T> {}
18+
interface AsymmetricMatchersContaining extends CustomMatchers {}
19+
}
20+
1621
declare global {
1722
namespace jest {
1823
interface Matchers<R> {
1924
toBeJestCompatible(): R
2025
}
2126
}
22-
23-
namespace Vi {
24-
interface JestAssertion extends CustomMatchers {}
25-
interface AsymmetricMatchersContaining extends CustomMatchers {}
26-
}
2727
}
2828

2929
describe('jest-expect', () => {

0 commit comments

Comments
 (0)
Please sign in to comment.