Skip to content

Commit 79498da

Browse files
authored
test(fetch-client): restore globalThis.fetch in afterEach (#2668)
1 parent 1a4de21 commit 79498da

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

packages/clients/fetch-client/test/fetch-client.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ function makeSerializedResponseText(data: unknown) {
1818

1919
describe('createClient', () => {
2020
let mockFetch: ReturnType<typeof vi.fn>;
21+
const originalFetch = globalThis.fetch;
2122

2223
beforeEach(() => {
2324
mockFetch = vi.fn();
2425
globalThis.fetch = mockFetch as unknown as typeof globalThis.fetch;
2526
});
2627

2728
afterEach(() => {
29+
globalThis.fetch = originalFetch;
2830
vi.resetAllMocks();
2931
});
3032

0 commit comments

Comments
 (0)