From 47e4c4772f91548b7df505be9872c4ec4342072f Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Sat, 16 Sep 2023 14:37:44 +0800 Subject: [PATCH] fix: ignore ExperimentalWarning on esm module --- src/middleware/global_options.ts | 2 ++ test/cmd/test.test.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/middleware/global_options.ts b/src/middleware/global_options.ts index ed6259a..5701421 100644 --- a/src/middleware/global_options.ts +++ b/src/middleware/global_options.ts @@ -112,6 +112,8 @@ export default class implements ApplicationLifecycle { // https://nodejs.org/api/url.html#url_url_pathtofileurl_path esmLoader = pathToFileURL(esmLoader).href; } + // wait for https://github.com/nodejs/node/issues/40940 + addNodeOptionsToEnv('--no-warnings', ctx.env); addNodeOptionsToEnv(`--loader ${esmLoader}`, ctx.env); } diff --git a/test/cmd/test.test.ts b/test/cmd/test.test.ts index f282ddc..ceabf4b 100644 --- a/test/cmd/test.test.ts +++ b/test/cmd/test.test.ts @@ -176,6 +176,7 @@ describe('test/cmd/test.test.ts', () => { .debug() .expect('stdout', /should work/) .expect('stdout', /2 passing/) + .notExpect('stderr', /ExperimentalWarning/) .expect('code', 0) .end(); });