@ -34,12 +34,16 @@
// being in the test folder
// being in the test folder
process . chdir ( __ dirname ) ;
process . chdir ( __ dirname ) ;
child . exec ( process . execPath + ' test-init' , { env : { 'TEST_INIT' : 1 } } ,
// slow but simple
var envCopy = JSON . parse ( JSON . stringify ( process . env ) ) ;
envCopy . TEST_INIT = 1 ;
child . exec ( process . execPath + ' test-init' , { env : envCopy } ,
function ( err , stdout , stderr ) {
function ( err , stdout , stderr ) {
assert . equal ( stdout , 'Loaded successfully!' ,
assert . equal ( stdout , 'Loaded successfully!' ,
'`node test-init` failed!' ) ;
'`node test-init` failed!' ) ;
} ) ;
} ) ;
child . exec ( process . execPath + ' test-init.js' , { env : { 'TEST_INIT' : 1 } } ,
child . exec ( process . execPath + ' test-init.js' , { env : envCopy } ,
function ( err , stdout , stderr ) {
function ( err , stdout , stderr ) {
assert . equal ( stdout , 'Loaded successfully!' ,
assert . equal ( stdout , 'Loaded successfully!' ,
'`node test-init.js` failed!' ) ;
'`node test-init.js` failed!' ) ;
@ -48,7 +52,7 @@
// test-init-index is in fixtures dir as requested by ry, so go there
// test-init-index is in fixtures dir as requested by ry, so go there
process . chdir ( common . fixturesDir ) ;
process . chdir ( common . fixturesDir ) ;
child . exec ( process . execPath + ' test-init-index' , { env : { 'TEST_INIT' : 1 } } ,
child . exec ( process . execPath + ' test-init-index' , { env : envCopy } ,
function ( err , stdout , stderr ) {
function ( err , stdout , stderr ) {
assert . equal ( stdout , 'Loaded successfully!' ,
assert . equal ( stdout , 'Loaded successfully!' ,
'`node test-init-index failed!' ) ;
'`node test-init-index failed!' ) ;
@ -59,7 +63,7 @@
// expected in node
// expected in node
process . chdir ( common . fixturesDir + '/test-init-native/' ) ;
process . chdir ( common . fixturesDir + '/test-init-native/' ) ;
child . exec ( process . execPath + ' fs' , { env : { 'TEST_INIT' : 1 } } ,
child . exec ( process . execPath + ' fs' , { env : envCopy } ,
function ( err , stdout , stderr ) {
function ( err , stdout , stderr ) {
assert . equal ( stdout , 'fs loaded successfully' ,
assert . equal ( stdout , 'fs loaded successfully' ,
'`node fs` failed!' ) ;
'`node fs` failed!' ) ;