@@ -34,15 +34,15 @@ const fixtureThrows = fixture('throws_error4.js');
3434// test preloading a single module works
3535childProcess . exec ( nodeBinary + ' ' + preloadOption ( [ fixtureA ] ) + ' ' + fixtureB ,
3636 function ( err , stdout , stderr ) {
37- if ( err ) throw err ;
37+ assert . ifError ( err ) ;
3838 assert . strictEqual ( stdout , 'A\nB\n' ) ;
3939 } ) ;
4040
4141// test preloading multiple modules works
4242childProcess . exec (
4343 nodeBinary + ' ' + preloadOption ( [ fixtureA , fixtureB ] ) + ' ' + fixtureC ,
4444 function ( err , stdout , stderr ) {
45- if ( err ) throw err ;
45+ assert . ifError ( err ) ;
4646 assert . strictEqual ( stdout , 'A\nB\nC\n' ) ;
4747 }
4848) ;
@@ -63,7 +63,7 @@ childProcess.exec(
6363childProcess . exec (
6464 nodeBinary + ' ' + preloadOption ( [ fixtureA ] ) + '-e "console.log(\'hello\');"' ,
6565 function ( err , stdout , stderr ) {
66- if ( err ) throw err ;
66+ assert . ifError ( err ) ;
6767 assert . strictEqual ( stdout , 'A\nhello\n' ) ;
6868 }
6969) ;
@@ -110,7 +110,7 @@ childProcess.exec(
110110 nodeBinary + ' ' + preloadOption ( [ fixtureA ] ) +
111111 '-e "console.log(\'hello\');" ' + preloadOption ( [ fixtureA , fixtureB ] ) ,
112112 function ( err , stdout , stderr ) {
113- if ( err ) throw err ;
113+ assert . ifError ( err ) ;
114114 assert . strictEqual ( stdout , 'A\nB\nhello\n' ) ;
115115 }
116116) ;
@@ -131,7 +131,7 @@ childProcess.exec(
131131 nodeBinary + ' ' + '--require ' + fixture ( 'cluster-preload.js' ) + ' ' +
132132 fixture ( 'cluster-preload-test.js' ) ,
133133 function ( err , stdout , stderr ) {
134- if ( err ) throw err ;
134+ assert . ifError ( err ) ;
135135 assert . ok ( / w o r k e r t e r m i n a t e d w i t h c o d e 4 3 / . test ( stdout ) ) ;
136136 }
137137) ;
@@ -142,7 +142,7 @@ childProcess.exec(
142142 nodeBinary + ' ' + '--expose_debug_as=v8debug ' + '--require ' +
143143 fixture ( 'cluster-preload.js' ) + ' ' + 'cluster-preload-test.js' ,
144144 function ( err , stdout , stderr ) {
145- if ( err ) throw err ;
145+ assert . ifError ( err ) ;
146146 assert . ok ( / w o r k e r t e r m i n a t e d w i t h c o d e 4 3 / . test ( stdout ) ) ;
147147 }
148148) ;
0 commit comments