Skip to content

Commit fe2b241

Browse files
committed
boa: skip the esm tests for node >= 14.5.0
See nodejs/node#33501 At Node.js 14.5.0, it removes the dynamic module format, so we need to make compatible works for the new usage with esm loader. Node.js Release PR: nodejs/node#34093
1 parent 36bb8dc commit fe2b241

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

packages/boa/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ module.exports = {
193193
"no-param-reassign": "error",
194194
"no-path-concat": "error",
195195
"no-plusplus": "error",
196-
"no-process-env": "error",
196+
"no-process-env": "off",
197197
"no-process-exit": "error",
198198
"no-proto": "error",
199199
"no-restricted-globals": "error",

packages/boa/tests/es-module-loaders/common.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,18 @@ function getAbsolutePath(relativePath) {
1313
const FLAG = '--experimental-loader';
1414
const PATH_ESM_LOADER = getAbsolutePath('../../esm/loader.mjs');
1515

16-
// See https://github.com/nodejs/node/pull/29796
17-
if (process.version < 'v12.11.1') {
16+
const [major, minor, patch] = process.version.replace('v', '').split('.');
17+
if (major <= '12' && minor <= '11' && patch <= '1') {
18+
// See https://github.com/nodejs/node/pull/29796
1819
console.log(`1..0 # Skipped: Current nodejs version: ${
19-
process.version} does not support \`--experimental-loader\``);
20+
process.version} does not support \`--experimental-loader\`.`);
21+
process.exit(0);
22+
}
23+
if (major >= '14' && minor >= '5') {
24+
// https://github.com/nodejs/node/pull/33501
25+
// TODO(yorkie): compatible with the new esm hooks.
26+
console.log(`1..0 # Skipped: Current nodejs version ${
27+
process.version} does not support dynamic module type.`);
2028
process.exit(0);
2129
}
2230

0 commit comments

Comments
 (0)