@@ -19,15 +19,15 @@ if (typeof spawnTest !== 'function') {
1919// Successful child: exits 0, stderr empty, and harness globals are available
2020// inside the child (the child checks `typeof assert === 'function'` itself).
2121{
22- const result = spawnTest ( 'spawn-test-ok-child.mjs' ) ;
22+ const result = await spawnTest ( 'spawn-test-ok-child.mjs' ) ;
2323 assert . strictEqual ( result . status , 0 , `ok child exited with status ${ result . status } ; stderr:\n${ result . stderr } ` ) ;
2424 assert . strictEqual ( result . aborted , false ) ;
2525 assert . strictEqual ( result . stderr , '' ) ;
2626}
2727
2828// Failing child: non-zero status and stderr contains the thrown marker.
2929{
30- const result = spawnTest ( 'spawn-test-fail-child.mjs' ) ;
30+ const result = await spawnTest ( 'spawn-test-fail-child.mjs' ) ;
3131 assert . notStrictEqual ( result . status , 0 , 'fail child should exit non-zero' ) ;
3232 // A thrown error is a clean non-zero exit, not an abnormal termination.
3333 assert . strictEqual ( result . aborted , false ) ;
@@ -38,7 +38,7 @@ if (typeof spawnTest !== 'function') {
3838
3939// Result shape: all four fields are present.
4040{
41- const result = spawnTest ( 'spawn-test-ok-child.mjs' ) ;
41+ const result = await spawnTest ( 'spawn-test-ok-child.mjs' ) ;
4242 for ( const key of [ 'status' , 'aborted' , 'stdout' , 'stderr' ] ) {
4343 if ( ! ( key in result ) ) {
4444 throw new Error ( `Expected spawnTest result to have "${ key } " field` ) ;
@@ -56,7 +56,7 @@ if (typeof spawnTest !== 'function') {
5656// actually reached the terminal would need the child to write to stdout, which
5757// isn't expressible in portable ECMAScript, so we only check the contract here.)
5858{
59- const result = spawnTest ( 'spawn-test-ok-child.mjs' , { stdout : 'inherit' } ) ;
59+ const result = await spawnTest ( 'spawn-test-ok-child.mjs' , { stdout : 'inherit' } ) ;
6060 assert . strictEqual ( result . status , 0 , `ok child exited with status ${ result . status } ; stderr:\n${ result . stderr } ` ) ;
6161 assert . strictEqual ( result . stdout , '' , 'inherited stdout should not be captured' ) ;
6262}
@@ -65,7 +65,7 @@ if (typeof spawnTest !== 'function') {
6565// makes the bare child filename unresolvable. The child's stderr must name
6666// the specific file Node tried to load, proving cwd actually shifted.
6767{
68- const result = spawnTest ( 'spawn-test-ok-child.mjs' , { cwd : '..' } ) ;
68+ const result = await spawnTest ( 'spawn-test-ok-child.mjs' , { cwd : '..' } ) ;
6969 assert . notStrictEqual ( result . status , 0 , 'expected cwd ".." to make the child filename unresolvable' ) ;
7070 if ( ! result . stderr . includes ( 'spawn-test-ok-child.mjs' ) ) {
7171 throw new Error ( `Expected stderr to reference the unresolved child filename, got:\n${ result . stderr } ` ) ;
0 commit comments