From c0dda57f6461cde4b9312992f7a60d8b4f29e605 Mon Sep 17 00:00:00 2001 From: Dmytro Stanchiev Date: Thu, 30 Apr 2026 20:51:13 -0400 Subject: [PATCH] test: require explicit fetch mocks --- packages/core/test/setup.ts | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/packages/core/test/setup.ts b/packages/core/test/setup.ts index 412f8b8..8a5b105 100644 --- a/packages/core/test/setup.ts +++ b/packages/core/test/setup.ts @@ -1,11 +1,6 @@ -// Test setup for Bun test runner -// This file is loaded before any tests run due to bunfig.toml preload - -// Mock fetch globally for tests -global.fetch = - global.fetch || - (() => { - throw new Error("fetch is not available in test environment"); - }); - -// Add any global test utilities here +global.fetch = Object.assign( + () => { + throw new Error("Tests must mock fetch explicitly"); + }, + { preconnect: fetch.preconnect }, +) as typeof fetch;