Skip to content

Commit f8aa579

Browse files
committed
fix: export vitest expect extension types properly
1 parent dd9d264 commit f8aa579

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/vitest/src/vitest-extensions.ts

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'vitest';
12
import { expect } from 'vitest';
23
import { SyncExpectationResult } from '@vitest/expect';
34
import {
@@ -12,6 +13,7 @@ import {
1213
PatchedFetch,
1314
RawFetchMockMatchers,
1415
} from './types.js';
16+
import type { FetchMockMatchers } from './types.js';
1517

1618
function getFetchMockFromInput(input: PatchedFetch | FetchMock) {
1719
const fetchMock = (input as PatchedFetch)['fetchMock']
@@ -176,3 +178,8 @@ Object.entries(expectMethodNameToMethodMap).forEach(([humanVerb, method]) => {
176178

177179
expect.extend(extensions);
178180
});
181+
182+
declare module 'vitest' {
183+
interface Assertion extends FetchMockMatchers {} //eslint-disable-line @typescript-eslint/no-empty-object-type
184+
interface AsymmetricMatchersContaining extends FetchMockMatchers {} //eslint-disable-line @typescript-eslint/no-empty-object-type
185+
}

0 commit comments

Comments
 (0)