Skip to content

Commit b29b235

Browse files
herschel666codebytere
authored andcommitted
test: fix arguments order in assertions
Have the actual value first & the expected value second. PR-URL: #24149 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent d4fd76a commit b29b235

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

‎test/parallel/test-process-env.js‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ const assert = require('assert');
2626

2727
// changes in environment should be visible to child processes
2828
if(process.argv[2]==='you-are-the-child'){
29-
assert.strictEqual(false,'NODE_PROCESS_ENV_DELETED'inprocess.env);
30-
assert.strictEqual('42',process.env.NODE_PROCESS_ENV);
31-
assert.strictEqual('asdf',process.env.hasOwnProperty);
29+
assert.strictEqual('NODE_PROCESS_ENV_DELETED'inprocess.env,false);
30+
assert.strictEqual(process.env.NODE_PROCESS_ENV,'42');
31+
assert.strictEqual(process.env.hasOwnProperty,'asdf');
3232
consthasOwnProperty=Object.prototype.hasOwnProperty;
3333
consthas=hasOwnProperty.call(process.env,'hasOwnProperty');
34-
assert.strictEqual(true,has);
34+
assert.strictEqual(has,true);
3535
process.exit(0);
3636
}
3737

@@ -41,18 +41,18 @@ if (process.argv[2] === 'you-are-the-child'){
4141
assert.strictEqual(Object.prototype.hasOwnProperty,
4242
process.env.hasOwnProperty);
4343
consthas=process.env.hasOwnProperty('hasOwnProperty');
44-
assert.strictEqual(false,has);
44+
assert.strictEqual(has,false);
4545

4646
process.env.hasOwnProperty='asdf';
4747

4848
process.env.NODE_PROCESS_ENV=42;
49-
assert.strictEqual('42',process.env.NODE_PROCESS_ENV);
49+
assert.strictEqual(process.env.NODE_PROCESS_ENV,'42');
5050

5151
process.env.NODE_PROCESS_ENV_DELETED=42;
52-
assert.strictEqual(true,'NODE_PROCESS_ENV_DELETED'inprocess.env);
52+
assert.strictEqual('NODE_PROCESS_ENV_DELETED'inprocess.env,true);
5353

5454
deleteprocess.env.NODE_PROCESS_ENV_DELETED;
55-
assert.strictEqual(false,'NODE_PROCESS_ENV_DELETED'inprocess.env);
55+
assert.strictEqual('NODE_PROCESS_ENV_DELETED'inprocess.env,false);
5656

5757
constchild=spawn(process.argv[0],[process.argv[1],'you-are-the-child']);
5858
child.stdout.on('data',function(data){console.log(data.toString());});

0 commit comments

Comments
(0)