Skip to content

Commit bea0819

Browse files
chrisbautistajasnell
authored andcommitted
test: switch strictEqual parameters - actual first before expected
PR-URL: #23537 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent bd3b52f commit bea0819

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/pummel/test-exec.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ exec(
4747
console.log(`error!: ${err.code}`);
4848
console.log(`stdout: ${JSON.stringify(stdout)}`);
4949
console.log(`stderr: ${JSON.stringify(stderr)}`);
50-
assert.strictEqual(false, err.killed);
50+
assert.strictEqual(err.killed, false);
5151
} else {
5252
success_count++;
5353
console.dir(stdout);
@@ -59,11 +59,11 @@ exec(
5959
exec('thisisnotavalidcommand', function(err, stdout, stderr) {
6060
if (err) {
6161
error_count++;
62-
assert.strictEqual('', stdout);
62+
assert.strictEqual(stdout, '');
6363
assert.strictEqual(typeof err.code, 'number');
6464
assert.notStrictEqual(err.code, 0);
65-
assert.strictEqual(false, err.killed);
66-
assert.strictEqual(null, err.signal);
65+
assert.strictEqual(err.killed, false);
66+
assert.strictEqual(err.signal, null);
6767
console.log(`error code: ${err.code}`);
6868
console.log(`stdout: ${JSON.stringify(stdout)}`);
6969
console.log(`stderr: ${JSON.stringify(stderr)}`);
@@ -97,7 +97,7 @@ process.nextTick(function() {
9797
console.log(`kill pid ${killMeTwice.pid}`);
9898
// make sure there is no race condition in starting the process
9999
// the PID SHOULD exist directly following the exec() call.
100-
assert.strictEqual('number', typeof killMeTwice._handle.pid);
100+
assert.strictEqual(typeof killMeTwice._handle.pid, 'number');
101101
// Kill the process
102102
killMeTwice.kill();
103103
});
@@ -128,6 +128,6 @@ exec('python -c "print 200000*\'C\'"', { maxBuffer: 1000 },
128128

129129

130130
process.on('exit', function() {
131-
assert.strictEqual(1, success_count);
132-
assert.strictEqual(1, error_count);
131+
assert.strictEqual(success_count, 1);
132+
assert.strictEqual(error_count, 1);
133133
});

0 commit comments

Comments
 (0)