mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
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:
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 () => {
|
||||
|
||||
Reference in new issue
Block a user