Repository: apollographql/apollo-client

Problem statement:
chore(deps): update dependency typescript to v4
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [typescript](https://www.typescriptlang.org/) ([source](https://togithub.com/Microsoft/TypeScript)) | [`3.9.9` -> `4.3.2`](https://renovatebot.com/diffs/npm/typescript/3.9.9/4.3.2) | [![age](https://badges.renovateapi.com/packages/npm/typescript/4.3.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/typescript/4.3.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/typescript/4.3.2/compatibility-slim/3.9.9)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/typescript/4.3.2/confidence-slim/3.9.9)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>Microsoft/TypeScript</summary>

### [`v4.3.2`](https://togithub.com/Microsoft/TypeScript/releases/v4.3.2)

[Compare Source](https://togithub.com/Microsoft/TypeScript/compare/v4.2.4...v4.3.2)

For release notes, check out the [release announcement](https://devblogs.microsoft.com/typescript/announcing-typescript-4-3).

For the complete list of fixed issues, check out the

-   [fixed issues query for TypeScript v4.3.0 (Beta)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.3.0%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.3.1 (RC)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.3.1%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.3.2](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.3.2%22+is%3Aclosed+).

Downloads are available on:

-   [npm](https://www.npmjs.com/package/typescript)
-   [Visual Studio 2017/2019](https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.TypeScript-43) ([Select new version in project options](https://togithub.com/Microsoft/TypeScript/wiki/Updating-TypeScript-in-Visual-Studio-2017))
-   [NuGet package](https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild)

### [`v4.2.4`](https://togithub.com/Microsoft/TypeScript/releases/v4.2.4)

[Compare Source](https://togithub.com/Microsoft/TypeScript/compare/v4.2.3...v4.2.4)

For release notes, check out the [release announcement](https://devblogs.microsoft.com/typescript/announcing-typescript-4-2).

For the complete list of fixed issues, check out the

-   [fixed issues query for TypeScript v4.2.0 (Beta)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.2.0%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.2.1 (RC)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.2.1%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.2.2 (Stable)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.2.2%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.2.3](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.2.3%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.2.4](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.2.4%22+is%3Aclosed+).

Downloads are available on:

-   [npm](https://www.npmjs.com/package/typescript)
-   [Visual Studio 2017/2019](https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.TypeScript-424) ([Select new version in project options](https://togithub.com/Microsoft/TypeScript/wiki/Updating-TypeScript-in-Visual-Studio-2017))
-   [NuGet package](https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild)

### [`v4.2.3`](https://togithub.com/Microsoft/TypeScript/releases/v4.2.3)

[Compare Source](https://togithub.com/Microsoft/TypeScript/compare/v4.2.2...v4.2.3)

For release notes, check out the [release announcement](https://devblogs.microsoft.com/typescript/announcing-typescript-4-2).

For the complete list of fixed issues, check out the

-   [fixed issues query for TypeScript v4.2.0 (Beta)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.2.0%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.2.1 (RC)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.2.1%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.2.2 (Stable)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.2.2%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.2.3](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.2.3%22+is%3Aclosed+).

Downloads are available on:

-   [npm](https://www.npmjs.com/package/typescript)
-   [Visual Studio 2017/2019](https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.TypeScript-423) ([Select new version in project options](https://togithub.com/Microsoft/TypeScript/wiki/Updating-TypeScript-in-Visual-Studio-2017))
-   [NuGet package](https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild)

### [`v4.2.2`](https://togithub.com/Microsoft/TypeScript/releases/v4.2.2)

[Compare Source](https://togithub.com/Microsoft/TypeScript/compare/v4.1.5...v4.2.2)

For release notes, check out the [release announcement](https://devblogs.microsoft.com/typescript/announcing-typescript-4-2).

For the complete list of fixed issues, check out the

-   [fixed issues query for TypeScript v4.2.0 (Beta)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.2.0%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.2.1 (RC)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.2.1%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.2.2](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.2.2%22+is%3Aclosed+).

Downloads are available on:

-   [npm](https://www.npmjs.com/package/typescript)
-   [Visual Studio 2017/2019](https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.TypeScript-42) ([Select new version in project options](https://togithub.com/Microsoft/TypeScript/wiki/Updating-TypeScript-in-Visual-Studio-2017))
-   [NuGet package](https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild)

### [`v4.1.5`](https://togithub.com/Microsoft/TypeScript/releases/v4.1.5)

[Compare Source](https://togithub.com/Microsoft/TypeScript/compare/v4.1.4...v4.1.5)

This release contains a fix for [an issue when language service plugins have no specified name](https://togithub.com/microsoft/TypeScript/issues/42718).

### [`v4.1.4`](https://togithub.com/Microsoft/TypeScript/releases/v4.1.4)

[Compare Source](https://togithub.com/Microsoft/TypeScript/compare/v4.1.3...v4.1.4)

This release contains fixes for a [security risk involving language service plugin loading](https://togithub.com/microsoft/TypeScript/issues/42712). More details are available [here](https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-1639).

### [`v4.1.3`](https://togithub.com/Microsoft/TypeScript/releases/v4.1.3)

[Compare Source](https://togithub.com/Microsoft/TypeScript/compare/v4.1.2...v4.1.3)

For release notes, check out the [release announcement](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1).

For the complete list of fixed issues, check out the

-   [fixed issues query for TypeScript v4.1.0 (Beta)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.1.0%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.1.1 (RC)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.1.1%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.1.2 (Stable)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.1.2%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.1.3 (Stable)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.1.3%22+is%3Aclosed+).

Downloads are available on:

-   [npm](https://www.npmjs.com/package/typescript)
-   [Visual Studio 2017/2019](https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.TypeScript-41) ([Select new version in project options](https://togithub.com/Microsoft/TypeScript/wiki/Updating-TypeScript-in-Visual-Studio-2017))
-   [NuGet package](https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild)

### [`v4.1.2`](https://togithub.com/Microsoft/TypeScript/releases/v4.1.2)

[Compare Source](https://togithub.com/Microsoft/TypeScript/compare/v4.0.7...v4.1.2)

For release notes, check out the [release announcement](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1).

For the complete list of fixed issues, check out the

-   [fixed issues query for TypeScript v4.1.0 (Beta)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.1.0%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.1.1 (RC)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.1.1%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.1.2 (Stable)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.1.2%22+is%3Aclosed+).

Downloads are available on:

-   [npm](https://www.npmjs.com/package/typescript)
-   [Visual Studio 2017/2019](https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.TypeScript-41) ([Select new version in project options](https://togithub.com/Microsoft/TypeScript/wiki/Updating-TypeScript-in-Visual-Studio-2017))
-   [NuGet package](https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild)

### [`v4.0.7`](https://togithub.com/Microsoft/TypeScript/releases/v4.0.7)

[Compare Source](https://togithub.com/Microsoft/TypeScript/compare/v4.0.6...v4.0.7)

This release contains a fix for [an issue when language service plugins have no specified name](https://togithub.com/microsoft/TypeScript/issues/42718).

### [`v4.0.6`](https://togithub.com/Microsoft/TypeScript/releases/v4.0.6)

[Compare Source](https://togithub.com/Microsoft/TypeScript/compare/v4.0.5...v4.0.6)

This release contains fixes for a [security risk involving language service plugin loading](https://togithub.com/microsoft/TypeScript/issues/42712). More details are available [here](https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-1639).

### [`v4.0.5`](https://togithub.com/Microsoft/TypeScript/releases/v4.0.5)

[Compare Source](https://togithub.com/Microsoft/TypeScript/compare/v4.0.3...v4.0.5)

For release notes, check out the [release announcement](https://devblogs.microsoft.com/typescript/announcing-typescript-4-0/).

For the complete list of fixed issues, check out the

-   [fixed issues query for TypeScript v4.0.0 (Beta)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.0.0%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.0.1 (RC)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.0.1%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.0.2](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.0.2%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.0.3](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=milestone%3A%22TypeScript+4.0.3%22+is%3Aclosed+).
-   TypeScript 4.0.4 NOT FOUND
-   [fixed issues query for TypeScript v4.0.5](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=milestone%3A%22TypeScript+4.0.5%22+is%3Aclosed+).

Downloads are available on:

-   [npm](https://www.npmjs.com/package/typescript)

### [`v4.0.3`](https://togithub.com/Microsoft/TypeScript/releases/v4.0.3)

[Compare Source](https://togithub.com/Microsoft/TypeScript/compare/v4.0.2...v4.0.3)

For release notes, check out the [release announcement](https://devblogs.microsoft.com/typescript/announcing-typescript-4-0/).

For the complete list of fixed issues, check out the

-   [fixed issues query for TypeScript v4.0.0 (Beta)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.0.0%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.0.1 (RC)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.0.1%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.0.2](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.0.2%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.0.3](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=milestone%3A%22TypeScript+4.0.3%22+is%3Aclosed+).

Downloads are available on:

-   [npm](https://www.npmjs.com/package/typescript)
-   [Visual Studio 2017/2019](https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.TypeScript-40) ([Select new version in project options](https://togithub.com/Microsoft/TypeScript/wiki/Updating-TypeScript-in-Visual-Studio-2017))
-   [NuGet package](https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild)

### [`v4.0.2`](https://togithub.com/Microsoft/TypeScript/releases/v4.0.2)

[Compare Source](https://togithub.com/Microsoft/TypeScript/compare/v3.9.9...v4.0.2)

For release notes, check out the [release announcement](https://devblogs.microsoft.com/typescript/announcing-typescript-4-0/).

For the complete list of fixed issues, check out the

-   [fixed issues query for TypeScript v4.0.0 (Beta)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.0.0%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.0.1 (RC)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.0.1%22+is%3Aclosed+).
-   [fixed issues query for TypeScript v4.0.2](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=is%3Aissue+milestone%3A%22TypeScript+4.0.2%22+is%3Aclosed+).

Downloads are available on:

-   [npm](https://www.npmjs.com/package/typescript)
-   [Visual Studio 2017/2019](https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.TypeScript-40) ([Select new version in project options](https://togithub.com/Microsoft/TypeScript/wiki/Updating-TypeScript-in-Visual-Studio-2017))
-   [NuGet package](https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild)

</details>

---

### Configuration

📅 **Schedule**: "every weekend" in timezone America/Los_Angeles.

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻️ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/apollographql/apollo-client).


Hints:

Patch:
diff --git a/config/helpers.ts b/config/helpers.ts
--- a/config/helpers.ts
+++ b/config/helpers.ts
@@ -11,7 +11,7 @@ export function eachFile(dir: string, callback: (
 ) => any) {
   const promises: Promise<any>[] = [];
 
-  return new Promise((resolve, reject) => {
+  return new Promise<void>((resolve, reject) => {
     glob(`${dir}/**/*.js`, (error, files) => {
       if (error) return reject(error);
 
diff --git a/src/core/ObservableQuery.ts b/src/core/ObservableQuery.ts
--- a/src/core/ObservableQuery.ts
+++ b/src/core/ObservableQuery.ts
@@ -61,9 +61,9 @@ export class ObservableQuery<
   private observers = new Set<Observer<ApolloQueryResult<TData>>>();
   private subscriptions = new Set<ObservableSubscription>();
 
-  private lastResult: ApolloQueryResult<TData>;
-  private lastResultSnapshot: ApolloQueryResult<TData>;
-  private lastError: ApolloError;
+  private lastResult: ApolloQueryResult<TData> | undefined;
+  private lastResultSnapshot: ApolloQueryResult<TData> | undefined;
+  private lastError: ApolloError | undefined;
   private queryInfo: QueryInfo;
 
   constructor({
@@ -134,11 +134,11 @@ export class ObservableQuery<
       (lastResult && lastResult.networkStatus) ||
       NetworkStatus.ready;
 
-    const result: ApolloQueryResult<TData> = {
+    const result = {
       ...lastResult,
       loading: isNetworkRequestInFlight(networkStatus),
       networkStatus,
-    };
+    } as ApolloQueryResult<TData>;
 
     if (this.isTornDown) {
       return result;
@@ -208,11 +208,11 @@ export class ObservableQuery<
 
   // Returns the last result that observer.next was called with. This is not the same as
   // getCurrentResult! If you're not sure which you need, then you probably need getCurrentResult.
-  public getLastResult(): ApolloQueryResult<TData> {
+  public getLastResult(): ApolloQueryResult<TData> | undefined {
     return this.lastResult;
   }
 
-  public getLastError(): ApolloError {
+  public getLastError(): ApolloError | undefined {
     return this.lastError;
   }
 
@@ -623,7 +623,7 @@ once, rather than every time you call fetchMore.`);
         errors: error.graphQLErrors,
         networkStatus: NetworkStatus.error,
         loading: false,
-      });
+      } as ApolloQueryResult<TData>);
 
       iterateObserversSafely(this.observers, 'error', this.lastError = error);
     },


Test patch:
diff --git a/src/__tests__/client.ts b/src/__tests__/client.ts
--- a/src/__tests__/client.ts
+++ b/src/__tests__/client.ts
@@ -2582,8 +2582,9 @@ describe('client', () => {
         const lastError = observable.getLastError();
         const lastResult = observable.getLastResult();
 
-        expect(lastResult.loading).toBeFalsy();
-        expect(lastResult.networkStatus).toBe(8);
+        expect(lastResult).toBeTruthy();
+        expect(lastResult!.loading).toBe(false);
+        expect(lastResult!.networkStatus).toBe(8);
 
         observable.resetLastResults();
         subscription = observable.subscribe(observerOptions);
diff --git a/src/__tests__/graphqlSubscriptions.ts b/src/__tests__/graphqlSubscriptions.ts
--- a/src/__tests__/graphqlSubscriptions.ts
+++ b/src/__tests__/graphqlSubscriptions.ts
@@ -190,7 +190,7 @@ describe('GraphQL Subscriptions', () => {
     const promises = [];
     for (let i = 0; i < 2; i += 1) {
       promises.push(
-        new Promise((resolve, reject) => {
+        new Promise<void>((resolve, reject) => {
           obs.subscribe({
             next(result) {
               fail('Should have hit the error block');
@@ -234,7 +234,7 @@ describe('GraphQL Subscriptions', () => {
       cache: new InMemoryCache({ addTypename: false }),
     });
 
-    return new Promise(resolve => {
+    return new Promise<void>(resolve => {
       client.subscribe(defaultOptions).subscribe({
         complete() {
           resolve();
diff --git a/src/__tests__/local-state/resolvers.ts b/src/__tests__/local-state/resolvers.ts
--- a/src/__tests__/local-state/resolvers.ts
+++ b/src/__tests__/local-state/resolvers.ts
@@ -447,7 +447,7 @@ describe('Basic resolver capabilities', () => {
     });
 
     function check(result: ApolloQueryResult<any>) {
-      return new Promise(resolve => {
+      return new Promise<void>(resolve => {
         expect(result.data.developer.id).toBe(developerId);
         expect(result.data.developer.handle).toBe('@benjamn');
         expect(result.data.developer.tickets.length).toBe(ticketsPerDev);
diff --git a/src/cache/inmemory/__tests__/readFromStore.ts b/src/cache/inmemory/__tests__/readFromStore.ts
--- a/src/cache/inmemory/__tests__/readFromStore.ts
+++ b/src/cache/inmemory/__tests__/readFromStore.ts
@@ -1710,7 +1710,7 @@ describe('reading from the store', () => {
       ...snapshotAfterGC,
       __META: zeusMeta,
     };
-    delete snapshotWithoutAres["Deity:{\"name\":\"Ares\"}"];
+    delete (snapshotWithoutAres as any)["Deity:{\"name\":\"Ares\"}"];
     expect(cache.extract()).toEqual(snapshotWithoutAres);
     // Ares already removed, so no new garbage to collect.
     expect(cache.gc()).toEqual([]);
diff --git a/src/core/__tests__/QueryManager/index.ts b/src/core/__tests__/QueryManager/index.ts
--- a/src/core/__tests__/QueryManager/index.ts
+++ b/src/core/__tests__/QueryManager/index.ts
@@ -5440,7 +5440,7 @@ describe('QueryManager', () => {
   describe('awaitRefetchQueries', () => {
     const awaitRefetchTest =
     ({ awaitRefetchQueries, testQueryError = false }: MutationBaseOptions<any, any, any> & { testQueryError?: boolean }) =>
-    new Promise((resolve, reject) => {
+    new Promise<void>((resolve, reject) => {
       const query = gql`
         query getAuthors($id: ID!) {
           author(id: $id) {
@@ -5540,7 +5540,7 @@ describe('QueryManager', () => {
           expect(stripSymbols(result.data)).toEqual(secondReqData);
         },
       )
-      .then(resolve)
+      .then(() => resolve())
       .catch(error => {
         const isRefetchError = awaitRefetchQueries && testQueryError &&
           error.message.includes(refetchError?.message);
diff --git a/src/link/http/__tests__/HttpLink.ts b/src/link/http/__tests__/HttpLink.ts
--- a/src/link/http/__tests__/HttpLink.ts
+++ b/src/link/http/__tests__/HttpLink.ts
@@ -11,6 +11,7 @@ import { ClientParseError } from '../serializeFetchParameter';
 import { ServerParseError } from '../parseAndCheckHttpResponse';
 import { ServerError } from '../../..';
 import DoneCallback = jest.DoneCallback;
+import { voidFetchDuringEachTest } from './helpers';
 
 const sampleQuery = gql`
   query SampleQuery {
@@ -907,15 +908,7 @@ describe('HttpLink', () => {
   });
 
   describe('Dev warnings', () => {
-    let oldFetch: WindowOrWorkerGlobalScope['fetch'];;
-    beforeEach(() => {
-      oldFetch = window.fetch;
-      delete window.fetch;
-    });
-
-    afterEach(() => {
-      window.fetch = oldFetch;
-    });
+    voidFetchDuringEachTest();
 
     it('warns if fetch is undeclared', done => {
       try {
diff --git a/src/link/http/__tests__/checkFetcher.ts b/src/link/http/__tests__/checkFetcher.ts
--- a/src/link/http/__tests__/checkFetcher.ts
+++ b/src/link/http/__tests__/checkFetcher.ts
@@ -1,15 +1,8 @@
 import { checkFetcher } from '../checkFetcher';
+import { voidFetchDuringEachTest } from './helpers';
 
 describe('checkFetcher', () => {
-  let oldFetch: WindowOrWorkerGlobalScope['fetch'];
-  beforeEach(() => {
-    oldFetch = window.fetch;
-    delete window.fetch;
-  });
-
-  afterEach(() => {
-    window.fetch = oldFetch;
-  });
+  voidFetchDuringEachTest();
 
   it('throws if no fetch is present', () => {
     expect(() => checkFetcher(undefined)).toThrow(
diff --git a/src/link/http/__tests__/helpers.ts b/src/link/http/__tests__/helpers.ts
new file mode 100644
--- /dev/null
+++ b/src/link/http/__tests__/helpers.ts
@@ -0,0 +1,29 @@
+export function voidFetchDuringEachTest() {
+  let fetchDesc = Object.getOwnPropertyDescriptor(window, "fetch");
+
+  beforeEach(() => {
+    fetchDesc = fetchDesc || Object.getOwnPropertyDescriptor(window, "fetch");
+    if (fetchDesc?.configurable) {
+      delete (window as any).fetch;
+    }
+  });
+
+  afterEach(() => {
+    if (fetchDesc?.configurable) {
+      Object.defineProperty(window, "fetch", fetchDesc);
+    }
+  });
+}
+
+describe("voidFetchDuringEachTest", () => {
+  voidFetchDuringEachTest();
+
+  it("hides the global.fetch function", () => {
+    expect(window.fetch).toBe(void 0);
+    expect(() => fetch).toThrowError(ReferenceError);
+  });
+
+  it("globalThis === window", () => {
+    expect(globalThis).toBe(window);
+  });
+});
diff --git a/src/link/retry/__tests__/retryLink.ts b/src/link/retry/__tests__/retryLink.ts
--- a/src/link/retry/__tests__/retryLink.ts
+++ b/src/link/retry/__tests__/retryLink.ts
@@ -67,7 +67,7 @@ describe('RetryLink', () => {
     const firstTry = fromError(standardError);
     // Hold the test hostage until we're hit
     let secondTry;
-    const untilSecondTry = new Promise(resolve => {
+    const untilSecondTry = new Promise<void>(resolve => {
       secondTry = {
         subscribe(observer: any) {
           resolve(); // Release hold on test.
diff --git a/src/react/hoc/__tests__/queries/errors.test.tsx b/src/react/hoc/__tests__/queries/errors.test.tsx
--- a/src/react/hoc/__tests__/queries/errors.test.tsx
+++ b/src/react/hoc/__tests__/queries/errors.test.tsx
@@ -252,7 +252,7 @@ describe('[queries] errors', () => {
   });
 
   it('will not log a warning when there is an error that is not caught in the render method when using query', () =>
-    new Promise((resolve, reject) => {
+    new Promise<void>((resolve, reject) => {
       const query: DocumentNode = gql`
         query people {
           allPeople(first: 1) {