test: switch strictEqual parameters - actual first before expected
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
0b0aeda2ce
commit
96311903e8
@ -47,7 +47,7 @@ exec(
|
|||||||
console.log(`error!: ${err.code}`);
|
console.log(`error!: ${err.code}`);
|
||||||
console.log(`stdout: ${JSON.stringify(stdout)}`);
|
console.log(`stdout: ${JSON.stringify(stdout)}`);
|
||||||
console.log(`stderr: ${JSON.stringify(stderr)}`);
|
console.log(`stderr: ${JSON.stringify(stderr)}`);
|
||||||
assert.strictEqual(false, err.killed);
|
assert.strictEqual(err.killed, false);
|
||||||
} else {
|
} else {
|
||||||
success_count++;
|
success_count++;
|
||||||
console.dir(stdout);
|
console.dir(stdout);
|
||||||
@ -59,11 +59,11 @@ exec(
|
|||||||
exec('thisisnotavalidcommand', function(err, stdout, stderr) {
|
exec('thisisnotavalidcommand', function(err, stdout, stderr) {
|
||||||
if (err) {
|
if (err) {
|
||||||
error_count++;
|
error_count++;
|
||||||
assert.strictEqual('', stdout);
|
assert.strictEqual(stdout, '');
|
||||||
assert.strictEqual(typeof err.code, 'number');
|
assert.strictEqual(typeof err.code, 'number');
|
||||||
assert.notStrictEqual(err.code, 0);
|
assert.notStrictEqual(err.code, 0);
|
||||||
assert.strictEqual(false, err.killed);
|
assert.strictEqual(err.killed, false);
|
||||||
assert.strictEqual(null, err.signal);
|
assert.strictEqual(err.signal, null);
|
||||||
console.log(`error code: ${err.code}`);
|
console.log(`error code: ${err.code}`);
|
||||||
console.log(`stdout: ${JSON.stringify(stdout)}`);
|
console.log(`stdout: ${JSON.stringify(stdout)}`);
|
||||||
console.log(`stderr: ${JSON.stringify(stderr)}`);
|
console.log(`stderr: ${JSON.stringify(stderr)}`);
|
||||||
@ -97,7 +97,7 @@ process.nextTick(function() {
|
|||||||
console.log(`kill pid ${killMeTwice.pid}`);
|
console.log(`kill pid ${killMeTwice.pid}`);
|
||||||
// make sure there is no race condition in starting the process
|
// make sure there is no race condition in starting the process
|
||||||
// the PID SHOULD exist directly following the exec() call.
|
// 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
|
// Kill the process
|
||||||
killMeTwice.kill();
|
killMeTwice.kill();
|
||||||
});
|
});
|
||||||
@ -128,6 +128,6 @@ exec('python -c "print 200000*\'C\'"', { maxBuffer: 1000 },
|
|||||||
|
|
||||||
|
|
||||||
process.on('exit', function() {
|
process.on('exit', function() {
|
||||||
assert.strictEqual(1, success_count);
|
assert.strictEqual(success_count, 1);
|
||||||
assert.strictEqual(1, error_count);
|
assert.strictEqual(error_count, 1);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user