@@ -8,6 +8,7 @@ describe('--experimental-detect-module', { concurrency: true }, () => {
88 describe ( 'string input' , { concurrency : true } , ( ) => {
99 it ( 'permits ESM syntax in --eval input without requiring --input-type=module' , async ( ) => {
1010 const { stdout, stderr, code, signal } = await spawnPromisified ( process . execPath , [
11+ '--no-warnings' ,
1112 '--experimental-detect-module' ,
1213 '--eval' ,
1314 'import { version } from "node:process"; console.log(version);' ,
@@ -23,6 +24,7 @@ describe('--experimental-detect-module', { concurrency: true }, () => {
2324
2425 it ( 'permits ESM syntax in STDIN input without requiring --input-type=module' , async ( ) => {
2526 const child = spawn ( process . execPath , [
27+ '--no-warnings' ,
2628 '--experimental-detect-module' ,
2729 ] ) ;
2830 child . stdin . end ( 'console.log(typeof import.meta.resolve)' ) ;
@@ -32,6 +34,7 @@ describe('--experimental-detect-module', { concurrency: true }, () => {
3234
3335 it ( 'should be overridden by --input-type' , async ( ) => {
3436 const { code, signal, stdout, stderr } = await spawnPromisified ( process . execPath , [
37+ '--no-warnings' ,
3538 '--experimental-detect-module' ,
3639 '--input-type=commonjs' ,
3740 '--eval' ,
@@ -46,6 +49,7 @@ describe('--experimental-detect-module', { concurrency: true }, () => {
4649
4750 it ( 'should be overridden by --experimental-default-type' , async ( ) => {
4851 const { code, signal, stdout, stderr } = await spawnPromisified ( process . execPath , [
52+ '--no-warnings' ,
4953 '--experimental-detect-module' ,
5054 '--experimental-default-type=commonjs' ,
5155 '--eval' ,
@@ -60,6 +64,7 @@ describe('--experimental-detect-module', { concurrency: true }, () => {
6064
6165 it ( 'does not trigger detection via source code `eval()`' , async ( ) => {
6266 const { code, signal, stdout, stderr } = await spawnPromisified ( process . execPath , [
67+ '--no-warnings' ,
6368 '--experimental-detect-module' ,
6469 '--eval' ,
6570 'eval("import \'nonexistent\';");' ,
@@ -101,6 +106,7 @@ describe('--experimental-detect-module', { concurrency: true }, () => {
101106 ] ) {
102107 it ( testName , async ( ) => {
103108 const { stdout, stderr, code, signal } = await spawnPromisified ( process . execPath , [
109+ '--no-warnings' ,
104110 '--experimental-detect-module' ,
105111 entryPath ,
106112 ] ) ;
@@ -142,6 +148,7 @@ describe('--experimental-detect-module', { concurrency: true }, () => {
142148 ] ) {
143149 it ( testName , async ( ) => {
144150 const { stdout, stderr, code, signal } = await spawnPromisified ( process . execPath , [
151+ '--no-warnings' ,
145152 '--experimental-detect-module' ,
146153 entryPath ,
147154 ] ) ;
@@ -156,6 +163,7 @@ describe('--experimental-detect-module', { concurrency: true }, () => {
156163 it ( 'should not hint wrong format in resolve hook' , async ( ) => {
157164 let writeSync ;
158165 const { stdout, stderr, code, signal } = await spawnPromisified ( process . execPath , [
166+ '--no-warnings' ,
159167 '--experimental-detect-module' ,
160168 '--no-warnings' ,
161169 '--loader' ,
@@ -194,6 +202,7 @@ describe('--experimental-detect-module', { concurrency: true }, () => {
194202 ] ) {
195203 it ( testName , async ( ) => {
196204 const { stdout, stderr, code, signal } = await spawnPromisified ( process . execPath , [
205+ '--no-warnings' ,
197206 '--experimental-detect-module' ,
198207 entryPath ,
199208 ] ) ;
@@ -223,6 +232,7 @@ describe('--experimental-detect-module', { concurrency: true }, () => {
223232 ] ) {
224233 it ( testName , async ( ) => {
225234 const { stdout, stderr, code, signal } = await spawnPromisified ( process . execPath , [
235+ '--no-warnings' ,
226236 '--experimental-detect-module' ,
227237 entryPath ,
228238 ] ) ;
@@ -239,6 +249,7 @@ describe('--experimental-detect-module', { concurrency: true }, () => {
239249 describe ( 'syntax that errors in CommonJS but works in ESM' , { concurrency : true } , ( ) => {
240250 it ( 'permits top-level `await`' , async ( ) => {
241251 const { stdout, stderr, code, signal } = await spawnPromisified ( process . execPath , [
252+ '--no-warnings' ,
242253 '--experimental-detect-module' ,
243254 '--eval' ,
244255 'await Promise.resolve(); console.log("executed");' ,
@@ -252,6 +263,7 @@ describe('--experimental-detect-module', { concurrency: true }, () => {
252263
253264 it ( 'permits top-level `await` above import/export syntax' , async ( ) => {
254265 const { stdout, stderr, code, signal } = await spawnPromisified ( process . execPath , [
266+ '--no-warnings' ,
255267 '--experimental-detect-module' ,
256268 '--eval' ,
257269 'await Promise.resolve(); import "node:os"; console.log("executed");' ,
@@ -265,6 +277,7 @@ describe('--experimental-detect-module', { concurrency: true }, () => {
265277
266278 it ( 'still throws on `await` in an ordinary sync function' , async ( ) => {
267279 const { stdout, stderr, code, signal } = await spawnPromisified ( process . execPath , [
280+ '--no-warnings' ,
268281 '--experimental-detect-module' ,
269282 '--eval' ,
270283 'function fn() { await Promise.resolve(); } fn();' ,
@@ -278,6 +291,7 @@ describe('--experimental-detect-module', { concurrency: true }, () => {
278291
279292 it ( 'throws on undefined `require` when top-level `await` triggers ESM parsing' , async ( ) => {
280293 const { stdout, stderr, code, signal } = await spawnPromisified ( process . execPath , [
294+ '--no-warnings' ,
281295 '--experimental-detect-module' ,
282296 '--eval' ,
283297 'const fs = require("node:fs"); await Promise.resolve();' ,
@@ -291,6 +305,7 @@ describe('--experimental-detect-module', { concurrency: true }, () => {
291305
292306 it ( 'permits declaration of CommonJS module variables' , async ( ) => {
293307 const { stdout, stderr, code, signal } = await spawnPromisified ( process . execPath , [
308+ '--no-warnings' ,
294309 '--experimental-detect-module' ,
295310 fixtures . path ( 'es-modules/package-without-type/commonjs-wrapper-variables.js' ) ,
296311 ] ) ;
@@ -303,6 +318,7 @@ describe('--experimental-detect-module', { concurrency: true }, () => {
303318
304319 it ( 'permits declaration of CommonJS module variables above import/export' , async ( ) => {
305320 const { stdout, stderr, code, signal } = await spawnPromisified ( process . execPath , [
321+ '--no-warnings' ,
306322 '--experimental-detect-module' ,
307323 '--eval' ,
308324 'const module = 3; import "node:os"; console.log("executed");' ,
@@ -316,6 +332,7 @@ describe('--experimental-detect-module', { concurrency: true }, () => {
316332
317333 it ( 'still throws on double `const` declaration not at the top level' , async ( ) => {
318334 const { stdout, stderr, code, signal } = await spawnPromisified ( process . execPath , [
335+ '--no-warnings' ,
319336 '--experimental-detect-module' ,
320337 '--eval' ,
321338 'function fn() { const require = 1; const require = 2; } fn();' ,
0 commit comments