test: refactor stdin-script-child#10321
test: refactor stdin-script-child#10321emanuelbuholzer wants to merge 2 commits intonodejs:masterfrom emanuelbuholzer:master
Conversation
- var -> const where possible - assert.equal -> assert.strictEqual - passed the setTimeout function a second parameter for readability - used assert.strictEqual for assert(!c) as it is expected to be 0 and not some other value
|
LGTM if CI is ✅ |
| @@ -22,11 +22,11 @@ child.stderr.on('data', function(c) { | |||
| }); | |||
|
|
|||
| child.on('close', function(c) { | |||
There was a problem hiding this comment.
Can you please wrap the callback with common.mustCall?
There was a problem hiding this comment.
We need butter better documentation for common.mustCall() for new contributors. I've just opened #10390 to slightly expand what we have.
@emanuelbuholzer If you need a little bit more information about common.mustCall(), it's at https://github.com/Trott/io.js/blob/bd2ae52fc3fbb9ce6c0e8c79ff5e67f8a742847b/test/README.md#mustcallfn-expected for now. You can also look at how it is used in other tests. And you can also ask questions here or on the #node-dev channel on Freenode IRC.
There was a problem hiding this comment.
Yes, I also think it needs some better documentation. I'll add my thoughts and experiences to the opened issue. I just checked the function out in the source code and will try to make the changes in a bit.
|
Landed bc57f24 |
- var -> const where possible - assert.equal -> assert.strictEqual - passed the setTimeout function a second parameter for readability - used assert.strictEqual for assert(!c) as it is expected to be 0 and not some other value PR-URL: #10321 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
|
Thanks for the contribution, @emanuelbuholzer! 🎉 |
- var -> const where possible - assert.equal -> assert.strictEqual - passed the setTimeout function a second parameter for readability - used assert.strictEqual for assert(!c) as it is expected to be 0 and not some other value PR-URL: #10321 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
- var -> const where possible - assert.equal -> assert.strictEqual - passed the setTimeout function a second parameter for readability - used assert.strictEqual for assert(!c) as it is expected to be 0 and not some other value PR-URL: #10321 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
- var -> const where possible - assert.equal -> assert.strictEqual - passed the setTimeout function a second parameter for readability - used assert.strictEqual for assert(!c) as it is expected to be 0 and not some other value PR-URL: #10321 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
- var -> const where possible - assert.equal -> assert.strictEqual - passed the setTimeout function a second parameter for readability - used assert.strictEqual for assert(!c) as it is expected to be 0 and not some other value PR-URL: #10321 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
- var -> const where possible - assert.equal -> assert.strictEqual - passed the setTimeout function a second parameter for readability - used assert.strictEqual for assert(!c) as it is expected to be 0 and not some other value PR-URL: #10321 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
- var -> const where possible - assert.equal -> assert.strictEqual - passed the setTimeout function a second parameter for readability - used assert.strictEqual for assert(!c) as it is expected to be 0 and not some other value PR-URL: #10321 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
- var -> const where possible - assert.equal -> assert.strictEqual - passed the setTimeout function a second parameter for readability - used assert.strictEqual for assert(!c) as it is expected to be 0 and not some other value PR-URL: #10321 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
- var -> const where possible - assert.equal -> assert.strictEqual - passed the setTimeout function a second parameter for readability - used assert.strictEqual for assert(!c) as it is expected to be 0 and not some other value PR-URL: #10321 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
- var -> const where possible - assert.equal -> assert.strictEqual - passed the setTimeout function a second parameter for readability - used assert.strictEqual for assert(!c) as it is expected to be 0 and not some other value PR-URL: #10321 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesDescription of change
not some other value