Skip to content

Commit

Permalink
use native AbortController (#11753)
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas authored Apr 4, 2024
1 parent 4900d5a commit 062394e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/FixJSDOMEnvironment.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class FixJSDOMEnvironment extends JSDOMEnvironment {
// and setting AbortController breaks PersistedQueryLink tests, which may
// indicate a memory leak
// this.global.fetch = fetch;
// this.global.AbortController = AbortController;
this.global.AbortController = AbortController;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,11 @@ describe("failure path", () => {
variables,
}).subscribe({ complete })
);

// fetch-mock holds a history of all options it has been called with
// that includes the `signal` option, which (with the native `AbortController`)
// has a reference to the `Request` instance, which will somehow reference our
// hash object
fetchMock.resetHistory();
await expect(hashRefs[0]).toBeGarbageCollected();
}
);
Expand Down

0 comments on commit 062394e

Please sign in to comment.