@@ -781,17 +781,27 @@ describe('Loader hooks', { concurrency: !process.env.TEST_PARALLEL }, () => {
781781 }
782782 } ) ;
783783
784- describe ( 'should use hooks' , async ( ) => {
785- const { code, signal, stdout, stderr } = await spawnPromisified ( process . execPath , [
786- '--import' ,
787- fixtures . fileURL ( 'es-module-loaders/builtin-named-exports.mjs' ) ,
788- fixtures . path ( 'es-modules/require-esm-throws-with-loaders.js' ) ,
789- ] ) ;
784+ describe ( 'should use hooks ' , async ( ) => {
785+ for ( const { testConfigName, additionalOptions } of [
786+ { testConfigName : 'without --experimental-detect-module' , additionalOptions : [ ] } ,
787+ { testConfigName : 'with --experimental-detect-module' , additionalOptions : [ '--experimental-detect-module' ] } ,
788+ ] ) {
789+ it ( testConfigName , async ( ) => {
790+ const { code, signal, stdout, stderr } = await spawnPromisified ( process . execPath , [
791+ ...additionalOptions ,
792+ '--import' ,
793+ '../es-module-loaders/builtin-named-exports.mjs' ,
794+ fixtures . path ( 'es-modules/require-esm-throws-with-loaders.js' ) ,
795+ ] , {
796+ cwd : fixtures . path ( 'es-modules' ) ,
797+ } ) ;
790798
791- assert . strictEqual ( stderr , '' ) ;
792- assert . strictEqual ( stdout , '' ) ;
793- assert . strictEqual ( code , 0 ) ;
794- assert . strictEqual ( signal , null ) ;
799+ assert . strictEqual ( stderr , '' ) ;
800+ assert . strictEqual ( stdout , '' ) ;
801+ assert . strictEqual ( code , 0 ) ;
802+ assert . strictEqual ( signal , null ) ;
803+ } ) ;
804+ }
795805 } ) ;
796806
797807 it ( 'should support source maps in commonjs translator' , async ( ) => {
0 commit comments