Skip to content

Commit a080bf0

Browse files
author
denisp22
committed
Use the node: URL scheme for Node.js builtin module imports in tests.
1 parent 0054381 commit a080bf0

34 files changed

+37
-36
lines changed

Cache.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { deepStrictEqual, strictEqual, throws } from "assert";
3+
import { deepStrictEqual, strictEqual, throws } from "node:assert";
44

55
import Cache from "./Cache.mjs";
66
import assertBundleSize from "./test/assertBundleSize.mjs";

CacheContext.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { strictEqual } from "assert";
3+
import { strictEqual } from "node:assert";
44
import React from "react";
55

66
import Cache from "./Cache.mjs";

HYDRATION_TIME_MS.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { strictEqual } from "assert";
3+
import { strictEqual } from "node:assert";
44

55
import HYDRATION_TIME_MS from "./HYDRATION_TIME_MS.mjs";
66
import assertBundleSize from "./test/assertBundleSize.mjs";

HydrationTimeStampContext.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { strictEqual } from "assert";
3+
import { strictEqual } from "node:assert";
44
import React from "react";
55

66
import HydrationTimeStampContext from "./HydrationTimeStampContext.mjs";

Loading.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { deepStrictEqual, strictEqual } from "assert";
3+
import { deepStrictEqual, strictEqual } from "node:assert";
44

55
import Loading from "./Loading.mjs";
66
import assertBundleSize from "./test/assertBundleSize.mjs";

LoadingCacheValue.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { deepStrictEqual, strictEqual, throws } from "assert";
3+
import { deepStrictEqual, strictEqual, throws } from "node:assert";
44

55
import Cache from "./Cache.mjs";
66
import Loading from "./Loading.mjs";

LoadingContext.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { strictEqual } from "assert";
3+
import { strictEqual } from "node:assert";
44
import React from "react";
55

66
import Loading from "./Loading.mjs";

Provider.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { strictEqual, throws } from "assert";
3+
import { strictEqual, throws } from "node:assert";
44
import React from "react";
55
import ReactTestRenderer from "react-test-renderer";
66

cacheDelete.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { deepStrictEqual, strictEqual, throws } from "assert";
3+
import { deepStrictEqual, strictEqual, throws } from "node:assert";
44

55
import Cache from "./Cache.mjs";
66
import cacheDelete from "./cacheDelete.mjs";

cacheEntryDelete.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { deepStrictEqual, strictEqual, throws } from "assert";
3+
import { deepStrictEqual, strictEqual, throws } from "node:assert";
44

55
import Cache from "./Cache.mjs";
66
import cacheEntryDelete from "./cacheEntryDelete.mjs";

cacheEntryPrune.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { deepStrictEqual, strictEqual, throws } from "assert";
3+
import { deepStrictEqual, strictEqual, throws } from "node:assert";
44

55
import Cache from "./Cache.mjs";
66
import cacheEntryPrune from "./cacheEntryPrune.mjs";

cacheEntrySet.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { deepStrictEqual, strictEqual, throws } from "assert";
3+
import { deepStrictEqual, strictEqual, throws } from "node:assert";
44

55
import Cache from "./Cache.mjs";
66
import cacheEntrySet from "./cacheEntrySet.mjs";

cacheEntryStale.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { deepStrictEqual, strictEqual, throws } from "assert";
3+
import { deepStrictEqual, strictEqual, throws } from "node:assert";
44

55
import Cache from "./Cache.mjs";
66
import cacheEntryStale from "./cacheEntryStale.mjs";

cachePrune.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { deepStrictEqual, strictEqual, throws } from "assert";
3+
import { deepStrictEqual, strictEqual, throws } from "node:assert";
44

55
import Cache from "./Cache.mjs";
66
import cachePrune from "./cachePrune.mjs";

cacheStale.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { deepStrictEqual, strictEqual, throws } from "assert";
3+
import { deepStrictEqual, strictEqual, throws } from "node:assert";
44

55
import Cache from "./Cache.mjs";
66
import cacheStale from "./cacheStale.mjs";

changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
- Updated the [`extract-files`](https://npm.im/extract-files) dependency to v13.
1212
- Updated dev dependencies.
13+
- Use the `node:` URL scheme for Node.js builtin module imports in tests.
1314
- Added missing readme “Installation” section import map instructions for [`is-plain-obj`](https://npm.im/is-plain-obj).
1415
- Added [Browserslist](https://browsersl.ist) links to the readme.
1516

fetchGraphQL.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { deepStrictEqual, strictEqual } from "assert";
3+
import { deepStrictEqual, strictEqual } from "node:assert";
44
import { Response } from "node-fetch";
55
import revertableGlobals from "revertable-globals";
66

fetchOptionsGraphQL.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { deepStrictEqual, strictEqual } from "assert";
3+
import { deepStrictEqual, strictEqual } from "node:assert";
44
import { File, FormData } from "node-fetch";
55
import revertableGlobals from "revertable-globals";
66

test/assertBundleSize.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// @ts-check
22

3-
import { fail } from "assert";
43
import esbuild from "esbuild";
54
import { gzipSize } from "gzip-size";
6-
import { fileURLToPath } from "url";
5+
import { fail } from "node:assert";
6+
import { fileURLToPath } from "node:url";
77

88
/**
99
* Asserts the minified and gzipped bundle size of a module.

test/assertInstanceOf.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @ts-check
22

3-
import { AssertionError } from "assert";
4-
import { inspect } from "util";
3+
import { AssertionError } from "node:assert";
4+
import { inspect } from "node:util";
55

66
/**
77
* Asserts a value is an instance of a given class.

test/assertTypeOf.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @ts-check
22

3-
import { AssertionError } from "assert";
4-
import { inspect } from "util";
3+
import { AssertionError } from "node:assert";
4+
import { inspect } from "node:util";
55

66
/**
77
* Asserts a value is a given type.

useAutoAbortLoad.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { notStrictEqual, ok, strictEqual, throws } from "assert";
3+
import { notStrictEqual, ok, strictEqual, throws } from "node:assert";
44
import React from "react";
55
import ReactTestRenderer from "react-test-renderer";
66

useAutoLoad.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { ok, strictEqual, throws } from "assert";
3+
import { ok, strictEqual, throws } from "node:assert";
44
import React from "react";
55
import ReactTestRenderer from "react-test-renderer";
66

useCache.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { deepStrictEqual, ok, strictEqual } from "assert";
3+
import { deepStrictEqual, ok, strictEqual } from "node:assert";
44
import React from "react";
55
import ReactTestRenderer from "react-test-renderer";
66

useCacheEntry.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @ts-check
2-
import { deepStrictEqual, ok, strictEqual, throws } from "assert";
2+
import { deepStrictEqual, ok, strictEqual, throws } from "node:assert";
33
import React from "react";
44
import ReactTestRenderer from "react-test-renderer";
55

useCacheEntryPrunePrevention.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { deepStrictEqual, ok, strictEqual, throws } from "assert";
3+
import { deepStrictEqual, ok, strictEqual, throws } from "node:assert";
44
import React from "react";
55
import ReactTestRenderer from "react-test-renderer";
66

useForceUpdate.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { ok, strictEqual } from "assert";
3+
import { ok, strictEqual } from "node:assert";
44
import React from "react";
55
import ReactTestRenderer from "react-test-renderer";
66

useLoadGraphQL.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { deepStrictEqual, fail, ok, strictEqual, throws } from "assert";
3+
import { deepStrictEqual, fail, ok, strictEqual, throws } from "node:assert";
44
import { AbortError, Response } from "node-fetch";
55
import React from "react";
66
import ReactTestRenderer from "react-test-renderer";

useLoadOnDelete.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { deepStrictEqual, ok, strictEqual, throws } from "assert";
3+
import { deepStrictEqual, ok, strictEqual, throws } from "node:assert";
44
import React from "react";
55
import ReactTestRenderer from "react-test-renderer";
66

useLoadOnMount.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { deepStrictEqual, ok, strictEqual, throws } from "assert";
3+
import { deepStrictEqual, ok, strictEqual, throws } from "node:assert";
44
import React from "react";
55
import ReactTestRenderer from "react-test-renderer";
66

useLoadOnStale.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { deepStrictEqual, ok, strictEqual, throws } from "assert";
3+
import { deepStrictEqual, ok, strictEqual, throws } from "node:assert";
44
import React from "react";
55
import ReactTestRenderer from "react-test-renderer";
66

useLoading.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { deepStrictEqual, ok, strictEqual } from "assert";
3+
import { deepStrictEqual, ok, strictEqual } from "node:assert";
44
import React from "react";
55
import ReactTestRenderer from "react-test-renderer";
66

useLoadingEntry.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { deepStrictEqual, ok, strictEqual, throws } from "assert";
3+
import { deepStrictEqual, ok, strictEqual, throws } from "node:assert";
44
import React from "react";
55
import ReactTestRenderer from "react-test-renderer";
66

useWaterfallLoad.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { deepStrictEqual, ok, rejects, strictEqual, throws } from "assert";
3+
import { deepStrictEqual, ok, rejects, strictEqual, throws } from "node:assert";
44
import React from "react";
55
import ReactDOMServer from "react-dom/server";
66
import waterfallRender from "react-waterfall-render/waterfallRender.mjs";

0 commit comments

Comments
 (0)