Skip to content

Commit 062394e

Browse files
authored
use native AbortController (#11753)
1 parent 4900d5a commit 062394e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

config/FixJSDOMEnvironment.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class FixJSDOMEnvironment extends JSDOMEnvironment {
1414
// and setting AbortController breaks PersistedQueryLink tests, which may
1515
// indicate a memory leak
1616
// this.global.fetch = fetch;
17-
// this.global.AbortController = AbortController;
17+
this.global.AbortController = AbortController;
1818
}
1919
}
2020

src/link/persisted-queries/__tests__/persisted-queries.test.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,11 @@ describe("failure path", () => {
573573
variables,
574574
}).subscribe({ complete })
575575
);
576-
576+
// fetch-mock holds a history of all options it has been called with
577+
// that includes the `signal` option, which (with the native `AbortController`)
578+
// has a reference to the `Request` instance, which will somehow reference our
579+
// hash object
580+
fetchMock.resetHistory();
577581
await expect(hashRefs[0]).toBeGarbageCollected();
578582
}
579583
);

0 commit comments

Comments
 (0)