Skip to content

Commit

Permalink
test: switch strictEqual parameters - actual first before expected
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
chrisbautista authored and MylesBorins committed Oct 30, 2018
1 parent a410488 commit 8d583a7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/pummel/test-exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ exec(
console.log(`error!: ${err.code}`);
console.log(`stdout: ${JSON.stringify(stdout)}`);
console.log(`stderr: ${JSON.stringify(stderr)}`);
assert.strictEqual(false, err.killed);
assert.strictEqual(err.killed, false);
} else {
success_count++;
console.dir(stdout);
Expand All @@ -59,11 +59,11 @@ exec(
exec('thisisnotavalidcommand', function(err, stdout, stderr) {
if (err) {
error_count++;
assert.strictEqual('', stdout);
assert.strictEqual(stdout, '');
assert.strictEqual(typeof err.code, 'number');
assert.notStrictEqual(err.code, 0);
assert.strictEqual(false, err.killed);
assert.strictEqual(null, err.signal);
assert.strictEqual(err.killed, false);
assert.strictEqual(err.signal, null);
console.log(`error code: ${err.code}`);
console.log(`stdout: ${JSON.stringify(stdout)}`);
console.log(`stderr: ${JSON.stringify(stderr)}`);
Expand Down Expand Up @@ -97,7 +97,7 @@ process.nextTick(function() {
console.log(`kill pid ${killMeTwice.pid}`);
// make sure there is no race condition in starting the process
// the PID SHOULD exist directly following the exec() call.
assert.strictEqual('number', typeof killMeTwice._handle.pid);
assert.strictEqual(typeof killMeTwice._handle.pid, 'number');
// Kill the process
killMeTwice.kill();
});
Expand Down Expand Up @@ -128,6 +128,6 @@ exec('python -c "print 200000*\'C\'"', { maxBuffer: 1000 },


process.on('exit', function() {
assert.strictEqual(1, success_count);
assert.strictEqual(1, error_count);
assert.strictEqual(success_count, 1);
assert.strictEqual(error_count, 1);
});

0 comments on commit 8d583a7

Please sign in to comment.