Skip to content

Commit

Permalink
Use the node: URL scheme for Node.js builtin module imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydenseric committed Oct 22, 2023
1 parent 602f7be commit 542ffc6
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 7 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 @@
- Run tests with Node.js v18, v20, v21.
- Updated `actions/checkout` to v3.
- Updated `actions/setup-node` to v3.
- Use the `node:` URL scheme for Node.js builtin module imports.
- 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`.

Expand Down
3 changes: 2 additions & 1 deletion createUploadLink.test.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import "./test/polyfillFile.mjs";

import { deepEqual, deepStrictEqual, strictEqual } from "node:assert";

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 { deepEqual, deepStrictEqual, strictEqual } from "assert";
import gql from "graphql-tag";
import revertableGlobals from "revertable-globals";

Expand Down
2 changes: 1 addition & 1 deletion formDataAppendFile.test.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "./test/polyfillFile.mjs";

import { strictEqual } from "assert";
import { strictEqual } from "node:assert";

import formDataAppendFile from "./formDataAppendFile.mjs";
import assertBundleSize from "./test/assertBundleSize.mjs";
Expand Down
5 changes: 3 additions & 2 deletions test/assertBundleSize.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { fail } from "assert";
import { fail } from "node:assert";
import { fileURLToPath } from "node:url";

import esbuild from "esbuild";
import { gzipSize } from "gzip-size";
import { fileURLToPath } from "url";

/**
* Asserts the minified and gzipped bundle size of a module.
Expand Down
2 changes: 1 addition & 1 deletion test/createUnexpectedCallError.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AssertionError } from "assert";
import { AssertionError } from "node:assert";

/**
* Creates an assertion error that a function was unexpectedly called.
Expand Down
2 changes: 1 addition & 1 deletion test/polyfillFile.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { File as NodeFile } from "buffer";
import { File as NodeFile } from "node:buffer";

// TODO: Delete this polyfill once all supported Node.js versions have the
// global `File`:
Expand Down
2 changes: 1 addition & 1 deletion test/timeLimitPromise.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AssertionError } from "assert";
import { AssertionError } from "node:assert";

/**
* Time limits a promise. It will reject with an assertion error if it doesn’t
Expand Down

0 comments on commit 542ffc6

Please sign in to comment.