test: cleanup test-stdout-close-catch.js#10006
test: cleanup test-stdout-close-catch.js#10006furnox wants to merge 2 commits intonodejs:masterfrom furnox:feature_close-catch
Conversation
Added common.mustCall in child process on 'close' callback Changed several 'var' statements to 'const' or 'let' where appropriate Also linting
| const child = child_process.exec(cmd); | ||
| let output = ''; | ||
| const outputExpect = { 'code': 'EPIPE', | ||
| 'errno': 'EPIPE', |
There was a problem hiding this comment.
I think these lines should probably be indented as well.
There was a problem hiding this comment.
@cjihrig - thanks for looking at this.
I'm perfectly happy to align to any coding style, however, what is the style to be? make lint didn't make a peep over the alignment of these lines. My own style would be to indent these lines like so:
const outputExpect = {
'code': 'EPIPE',
'errno': 'EPIPE',
'syscall': 'write'
};
but I don't know if that's the indentation you'd like to see.
There was a problem hiding this comment.
@furnox What you have as your preference there is fine. (That's my preference too but it's not universal on the project. Basically, as long as the property names are lined up, that's the main thing.)
When we get over a couple of issues that are preventing us from updating ESLint, we will have more strict linting for indentation. Thanks for bearing with us until then.
Also, while you're in here editing: it seems like the quotation marks around the property names are unnecessary. If I'm not mistaken, it could be written as:
const outputExpect = {
code: 'EPIPE',
errno: 'EPIPE',
syscall: 'write'
};If there's a good reason for the quotation marks, then I guess keep them, but if not, perhaps take this opportunity to remove them.
| assert.deepStrictEqual(output, outputExpect); | ||
| console.log('ok'); | ||
| }); | ||
| }), 1); |
There was a problem hiding this comment.
This isn't needed. 1 is the default for common.mustCall().
There was a problem hiding this comment.
Good point. I'll fix that.
Defaulting to mustCall number of 1. Indenting obj properties
|
Thanks! Landed in 4a08ac6. |
Added common.mustCall in child process on 'close' callback Changed several 'var' statements to 'const' or 'let' where appropriate Also linting PR-URL: #10006 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Added common.mustCall in child process on 'close' callback Changed several 'var' statements to 'const' or 'let' where appropriate Also linting PR-URL: #10006 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Added common.mustCall in child process on 'close' callback Changed several 'var' statements to 'const' or 'let' where appropriate Also linting PR-URL: #10006 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Added common.mustCall in child process on 'close' callback Changed several 'var' statements to 'const' or 'let' where appropriate Also linting PR-URL: #10006 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Added common.mustCall in child process on 'close' callback Changed several 'var' statements to 'const' or 'let' where appropriate Also linting PR-URL: #10006 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Added common.mustCall in child process on 'close' callback Changed several 'var' statements to 'const' or 'let' where appropriate Also linting PR-URL: #10006 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Added common.mustCall in child process on 'close' callback Changed several 'var' statements to 'const' or 'let' where appropriate Also linting PR-URL: #10006 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Added common.mustCall in child process on 'close' callback Changed several 'var' statements to 'const' or 'let' where appropriate Also linting PR-URL: #10006 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Checklist
make -j8 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
test
Description of change
Added common.mustCall in child process on 'close' callback
Changed several 'var' statements to 'const' or 'let' where appropriate
Also linting