test: fix LinkPreviewService test isolation

Restores globalThis.fetch after each test in LinkPreviewService test suite to prevent pollution of other tests with mocked implementations.

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-01-27 03:30:56 +00:00
1 parent d9cd2ff745
commit 65c26b8c1e
1 file changed
+6
@@ -14,6 +14,12 @@ globalThis.DOMParser = dom.window.DOMParser;
globalThis.URL = URL;
test("LinkPreviewService", async (t) => {
const originalFetch = globalThis.fetch;
t.afterEach(() => {
globalThis.fetch = originalFetch;
});
const service = new LinkPreviewService({ ttlMs: 1000 });
await t.test("initializes IndexedDB", async () => {