@@ -26,12 +26,12 @@ const assert = require('assert');
26
26
27
27
// changes in environment should be visible to child processes
28
28
if ( process . argv [ 2 ] === 'you-are-the-child' ) {
29
- assert . strictEqual ( false , 'NODE_PROCESS_ENV_DELETED' in process . env ) ;
30
- assert . strictEqual ( '42' , process . env . NODE_PROCESS_ENV ) ;
31
- assert . strictEqual ( 'asdf' , process . env . hasOwnProperty ) ;
29
+ assert . strictEqual ( 'NODE_PROCESS_ENV_DELETED' in process . env , false ) ;
30
+ assert . strictEqual ( process . env . NODE_PROCESS_ENV , '42' ) ;
31
+ assert . strictEqual ( process . env . hasOwnProperty , 'asdf' ) ;
32
32
const hasOwnProperty = Object . prototype . hasOwnProperty ;
33
33
const has = hasOwnProperty . call ( process . env , 'hasOwnProperty' ) ;
34
- assert . strictEqual ( true , has ) ;
34
+ assert . strictEqual ( has , true ) ;
35
35
process . exit ( 0 ) ;
36
36
}
37
37
@@ -41,18 +41,18 @@ if (process.argv[2] === 'you-are-the-child') {
41
41
assert . strictEqual ( Object . prototype . hasOwnProperty ,
42
42
process . env . hasOwnProperty ) ;
43
43
const has = process . env . hasOwnProperty ( 'hasOwnProperty' ) ;
44
- assert . strictEqual ( false , has ) ;
44
+ assert . strictEqual ( has , false ) ;
45
45
46
46
process . env . hasOwnProperty = 'asdf' ;
47
47
48
48
process . env . NODE_PROCESS_ENV = 42 ;
49
- assert . strictEqual ( '42' , process . env . NODE_PROCESS_ENV ) ;
49
+ assert . strictEqual ( process . env . NODE_PROCESS_ENV , '42' ) ;
50
50
51
51
process . env . NODE_PROCESS_ENV_DELETED = 42 ;
52
- assert . strictEqual ( true , 'NODE_PROCESS_ENV_DELETED' in process . env ) ;
52
+ assert . strictEqual ( 'NODE_PROCESS_ENV_DELETED' in process . env , true ) ;
53
53
54
54
delete process . env . NODE_PROCESS_ENV_DELETED ;
55
- assert . strictEqual ( false , 'NODE_PROCESS_ENV_DELETED' in process . env ) ;
55
+ assert . strictEqual ( 'NODE_PROCESS_ENV_DELETED' in process . env , false ) ;
56
56
57
57
const child = spawn ( process . argv [ 0 ] , [ process . argv [ 1 ] , 'you-are-the-child' ] ) ;
58
58
child . stdout . on ( 'data' , function ( data ) { console . log ( data . toString ( ) ) ; } ) ;
0 commit comments