Skip to content

Commit

Permalink
Fix tests broken by @apollo/client v3.7.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydenseric committed Oct 22, 2023
1 parent a687b6a commit 961cbc6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
- Updated `actions/checkout` to v3.
- Updated `actions/setup-node` to v3.
- Reorganized the test file structure.
- In tests, for objects with the property `headers` that as of [`@apollo/client`](https://npm.im/@apollo/client) [v3.7.0](https://github.com/apollographql/apollo-client/releases/tag/v3.7.0) is a null-prototype object, use the assertion `deepEqual` instead of `deepStrictEqual`.

## 17.0.0

Expand Down
28 changes: 14 additions & 14 deletions createUploadLink.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ApolloLink } from "@apollo/client/link/core/ApolloLink.js";
import { concat } from "@apollo/client/link/core/concat.js";
import { execute } from "@apollo/client/link/core/execute.js";
import { AbortController, AbortSignal } from "abort-controller";
import { deepStrictEqual, strictEqual } from "assert";
import { deepEqual, deepStrictEqual, strictEqual } from "assert";
import { File, FormData } from "formdata-node";
import gql from "graphql-tag";
import { AbortError, Response } from "node-fetch";
Expand Down Expand Up @@ -75,7 +75,7 @@ export default (tests) => {
if (global.AbortSignal)
strictEqual(fetchOptionsSignal instanceof global.AbortSignal, true);

deepStrictEqual(fetchOptionsRest, {
deepEqual(fetchOptionsRest, {
method: "POST",
headers: { accept: "*/*", "content-type": "application/json" },
body: JSON.stringify({ variables: {}, query }),
Expand Down Expand Up @@ -162,7 +162,7 @@ export default (tests) => {
strictEqual(formDataEntries[2][1] instanceof File, true);
strictEqual(formDataEntries[2][1].name, fileName);
strictEqual(formDataEntries[2][1].type, fileType);
deepStrictEqual(fetchOptionsRest, {
deepEqual(fetchOptionsRest, {
method: "POST",
headers: { accept: "*/*" },
});
Expand Down Expand Up @@ -222,7 +222,7 @@ export default (tests) => {
if (global.AbortSignal)
strictEqual(fetchOptionsSignal instanceof global.AbortSignal, true);

deepStrictEqual(fetchOptionsRest, {
deepEqual(fetchOptionsRest, {
method: "POST",
headers: { accept: "*/*", "content-type": "application/json" },
body: JSON.stringify({ variables: {}, query }),
Expand Down Expand Up @@ -284,7 +284,7 @@ export default (tests) => {
if (global.AbortSignal)
strictEqual(fetchOptionsSignal instanceof global.AbortSignal, true);

deepStrictEqual(fetchOptionsRest, {
deepEqual(fetchOptionsRest, {
method: "POST",
headers: { accept: "*/*", "content-type": "application/json" },
body: JSON.stringify({
Expand Down Expand Up @@ -351,7 +351,7 @@ export default (tests) => {
if (global.AbortSignal)
strictEqual(fetchOptionsSignal instanceof global.AbortSignal, true);

deepStrictEqual(fetchOptionsRest, {
deepEqual(fetchOptionsRest, {
method: "GET",
headers: { accept: "*/*", "content-type": "application/json" },
});
Expand Down Expand Up @@ -412,7 +412,7 @@ export default (tests) => {
if (global.AbortSignal)
strictEqual(fetchOptionsSignal instanceof global.AbortSignal, true);

deepStrictEqual(fetchOptionsRest, {
deepEqual(fetchOptionsRest, {
method: "GET",
headers: { accept: "*/*", "content-type": "application/json" },
});
Expand Down Expand Up @@ -501,7 +501,7 @@ export default (tests) => {
strictEqual(formDataEntries[2][1] instanceof File, true);
strictEqual(formDataEntries[2][1].name, fileName);
strictEqual(formDataEntries[2][1].type, fileType);
deepStrictEqual(fetchOptionsRest, {
deepEqual(fetchOptionsRest, {
method: "POST",
headers: { accept: "*/*" },
});
Expand Down Expand Up @@ -617,7 +617,7 @@ export default (tests) => {
if (global.AbortSignal)
strictEqual(fetchOptionsSignal instanceof global.AbortSignal, true);

deepStrictEqual(fetchOptionsRest, {
deepEqual(fetchOptionsRest, {
method: "POST",
headers: { accept: "*/*", "content-type": "application/json" },
body: JSON.stringify({ variables: {}, query }),
Expand Down Expand Up @@ -680,7 +680,7 @@ export default (tests) => {
if (global.AbortSignal)
strictEqual(fetchOptionsSignal instanceof global.AbortSignal, true);

deepStrictEqual(fetchOptionsRest, {
deepEqual(fetchOptionsRest, {
method: "POST",
headers: {
accept: "*/*",
Expand Down Expand Up @@ -757,7 +757,7 @@ export default (tests) => {
if (global.AbortSignal)
strictEqual(fetchOptionsSignal instanceof global.AbortSignal, true);

deepStrictEqual(fetchOptionsRest, {
deepEqual(fetchOptionsRest, {
method: "POST",
headers: {
accept: "*/*",
Expand Down Expand Up @@ -864,7 +864,7 @@ export default (tests) => {
strictEqual(formDataEntries[2][1] instanceof File, true);
strictEqual(formDataEntries[2][1].name, fileName);
strictEqual(formDataEntries[2][1].type, fileType);
deepStrictEqual(fetchOptionsRest, {
deepEqual(fetchOptionsRest, {
method: "POST",
headers: { accept: "*/*" },
});
Expand Down Expand Up @@ -1052,7 +1052,7 @@ export default (tests) => {
const observerError = await observerErrorPromise;

strictEqual(fetchUri, defaultUri);
deepStrictEqual(fetchOptions, {
deepEqual(fetchOptions, {
method: "POST",
headers: { accept: "*/*", "content-type": "application/json" },
body: JSON.stringify({ variables: {}, query }),
Expand Down Expand Up @@ -1118,7 +1118,7 @@ export default (tests) => {
const observerError = await observerErrorPromise;

strictEqual(fetchUri, defaultUri);
deepStrictEqual(fetchOptions, {
deepEqual(fetchOptions, {
method: "POST",
headers: { accept: "*/*", "content-type": "application/json" },
body: JSON.stringify({ variables: {}, query }),
Expand Down

0 comments on commit 961cbc6

Please sign in to comment.