-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: improve test-child-process-exec-buffer #10275
Conversation
b51feea
to
ac1a653
Compare
const assert = require('assert'); | ||
const exec = require('child_process').exec; | ||
const os = require('os'); | ||
const str = 'hello'; | ||
|
||
// default encoding | ||
exec('echo ' + str, common.mustCall(function(err, stdout, stderr) { | ||
assert.ok('string', typeof stdout, 'Expected stdout to be a string'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These assert.ok()
calls look wrong to me. Would you mean changing to assert.strictEqual()
and also switching their order (actual then expected).
@@ -18,5 +18,5 @@ exec('echo ' + str, { | |||
}, common.mustCall(function(err, stdout, stderr) { | |||
assert.ok(stdout instanceof Buffer, 'Expected stdout to be a Buffer'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These assert.ok()
calls look fine, but we could replace them for consistency.
* use const instead of var for required modules * use assert.strictEqual instead of assert.equal * use assert.strictEqual instead of assert.ok
ac1a653
to
fda691e
Compare
@cjihrig implemented your suggestions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Landed f7f662c |
* use const instead of var for required modules * use assert.strictEqual instead of assert.equal * use assert.strictEqual instead of assert.ok PR-URL: #10275 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Italo A. Casas <[email protected]>
* use const instead of var for required modules * use assert.strictEqual instead of assert.equal * use assert.strictEqual instead of assert.ok PR-URL: nodejs#10275 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Italo A. Casas <[email protected]>
* use const instead of var for required modules * use assert.strictEqual instead of assert.equal * use assert.strictEqual instead of assert.ok PR-URL: #10275 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Italo A. Casas <[email protected]>
* use const instead of var for required modules * use assert.strictEqual instead of assert.equal * use assert.strictEqual instead of assert.ok PR-URL: #10275 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Italo A. Casas <[email protected]>
* use const instead of var for required modules * use assert.strictEqual instead of assert.equal * use assert.strictEqual instead of assert.ok PR-URL: #10275 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Italo A. Casas <[email protected]>
* use const instead of var for required modules * use assert.strictEqual instead of assert.equal * use assert.strictEqual instead of assert.ok PR-URL: #10275 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Italo A. Casas <[email protected]>
Checklist
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
test
Description of change