Skip to content

Commit

Permalink
Update node 23.1 experimental warning (#16934)
Browse files Browse the repository at this point in the history
* Revert "fix: CI with Node v23.1.0 (#16932)"

This reverts commit 8b5b6bf.

* update known experimental warning regex
  • Loading branch information
JLHwung authored Oct 25, 2024
1 parent e5e3bd2 commit 61de718
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions packages/babel-core/test/helpers/esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,11 @@ async function spawn(runner, filename, cwd = process.cwd()) {
process.execPath,
// pass `cwd` as params as `process.cwd()` will normalize `cwd` on macOS
[require.resolve(`../fixtures/babel-${runner}.mjs`), filename, cwd],
{
cwd,
env: {
...process.env,
NODE_OPTIONS:
parseInt(process.versions.node) >= 23
? "--disable-warning=ExperimentalWarning"
: "",
},
},
{ cwd, env: process.env },
);

const EXPERIMENTAL_WARNING =
/\(node:\d+\) ExperimentalWarning: (The ESM module loader is experimental\.|Support for loading ES Module in require\(\) is an experimental feature and might change at any time\n\(Use `node --trace-warnings ...` to show where the warning was created\))/;
/\(node:\d+\) ExperimentalWarning: (The ESM module loader is experimental\.|CommonJS module .+? is loading ES Module .+? using require\(\)\.\nSupport for loading ES Module in require\(\) is an experimental feature and might change at any time\n\(Use `node --trace-warnings ...` to show where the warning was created\))/;

if (stderr.replace(EXPERIMENTAL_WARNING, "").trim()) {
throw new Error(
Expand Down

0 comments on commit 61de718

Please sign in to comment.