Skip to content

Commit

Permalink
rename abort controller mock to DummyAbortController
Browse files Browse the repository at this point in the history
  • Loading branch information
igor.luckenkov committed Feb 11, 2023
1 parent 8f84774 commit b4751f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/jsutils/AbortController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ export interface IAbortController {
abort: (reason?: any) => void;
}

// We need to polyfill abort controller in case of Node@14 which doesn't have it
/* c8 ignore start */
export const AbortController: new () => IAbortController =
// eslint-disable-next-line no-undef
global.AbortController ||
class MockAbortController implements IAbortController {
// This is a dummy implementation that doesn't actually abort anything
class DummyAbortController implements IAbortController {
private _signal: IAbortSignal = {
aborted: false,
addEventListener: () => null,
Expand Down

0 comments on commit b4751f4

Please sign in to comment.