From 3745548b1328ceddb7a0f96d35f8b8f904f78571 Mon Sep 17 00:00:00 2001 From: Hiroki Osame Date: Sat, 2 Sep 2023 10:05:58 +0900 Subject: [PATCH] fix: suppress import assertion warning (#300) --- src/suppress-warnings.cts | 5 ++++- tests/index.ts | 11 ++++++----- tests/utils/node-supports.ts | 3 ++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/suppress-warnings.cts b/src/suppress-warnings.cts index a675847a..ee6abf6b 100644 --- a/src/suppress-warnings.cts +++ b/src/suppress-warnings.cts @@ -4,8 +4,11 @@ const ignoreWarnings = new Set([ '--experimental-loader is an experimental feature. This feature could change at any time', 'Custom ESM Loaders is an experimental feature. This feature could change at any time', - // Changed in Node v18.13.0 via PR #45424 + // Changed in Node v18.13.0 via https://github.com/nodejs/node/pull/45424 'Custom ESM Loaders is an experimental feature and might change at any time', + + // For JSON modules via https://github.com/nodejs/node/pull/46901 + 'Import assertions are not a stable feature of the JavaScript language. Avoid relying on their current behavior and syntax as those might change in a future version of Node.js.', ]); const { emit } = process; diff --git a/tests/index.ts b/tests/index.ts index 00e36f25..91ecac3e 100644 --- a/tests/index.ts +++ b/tests/index.ts @@ -11,14 +11,15 @@ const packageTypes = [ const nodeVersions = [ '12.20.0', // CJS named export detection added - '12.22.11', + '12', ...( (process.env.CI && !isWin) ? [ - '14.19.1', - '16.13.2', - '17.8.0', - '18.13.0', + '14', + '16', + '17', + '18', + '20', ] : [] ), diff --git a/tests/utils/node-supports.ts b/tests/utils/node-supports.ts index 54d4bd81..d941b1bd 100644 --- a/tests/utils/node-supports.ts +++ b/tests/utils/node-supports.ts @@ -1,3 +1,4 @@ export default { - testRunner: '>= 18.0.0', + // https://nodejs.org/api/test.html#test-runner + testRunner: '^16.17.0 || >= 18.0.0', };