@@ -45,7 +45,7 @@ const order = [
45
45
'after two: <root>' ,
46
46
] . join ( '\n' ) ;
47
47
48
- test ( 'Using --require to define global hooks works ' , async ( t ) => {
48
+ test ( 'use --require to define global hooks' , async ( t ) => {
49
49
const { stdout } = await common . spawnPromisified ( process . execPath , [
50
50
...testArguments ,
51
51
'--require' , fixtures . path ( 'test-runner' , 'no-isolation' , 'global-hooks.cjs' ) ,
@@ -57,7 +57,19 @@ test('Using --require to define global hooks works', async (t) => {
57
57
t . assert . equal ( testHookOutput , order ) ;
58
58
} ) ;
59
59
60
- test ( 'Using --import to define global hooks works' , async ( t ) => {
60
+ test ( 'use --import (CJS) to define global hooks' , async ( t ) => {
61
+ const { stdout } = await common . spawnPromisified ( process . execPath , [
62
+ ...testArguments ,
63
+ '--import' , fixtures . fileURL ( 'test-runner' , 'no-isolation' , 'global-hooks.cjs' ) ,
64
+ ...testFiles ,
65
+ ] ) ;
66
+
67
+ const testHookOutput = stdout . split ( '\n▶' ) [ 0 ] ;
68
+
69
+ t . assert . equal ( testHookOutput , order ) ;
70
+ } ) ;
71
+
72
+ test ( 'use --import (ESM) to define global hooks' , async ( t ) => {
61
73
const { stdout } = await common . spawnPromisified ( process . execPath , [
62
74
...testArguments ,
63
75
'--import' , fixtures . fileURL ( 'test-runner' , 'no-isolation' , 'global-hooks.mjs' ) ,
0 commit comments