test: refactor /parallel/test-cluster-uncaught-exception.js to ES6#9239
test: refactor /parallel/test-cluster-uncaught-exception.js to ES6#9239deverickapollo wants to merge 2 commits intonodejs:masterfrom deverickapollo:2016-10-21-test-code-cleanup
Conversation
This commit replaces function expressions with ES6 arrow functions as well as improve the comparison operator to check if operands are of same types.
| process.exit(MAGIC_EXIT_CODE); | ||
| }); | ||
| }); | ||
| master.on('exit', common.mustCall(code => assert.strictEqual(code, MAGIC_EXIT_CODE))); |
There was a problem hiding this comment.
Are you sure you ran make -j8 test (or just make test, either is fine) on these changes? I would expect the linter to complain about this line as being too long.
| const isTestRunner = process.argv[2] !== 'child'; | ||
|
|
||
| if (isTestRunner) { | ||
| var master = fork(__filename, ['child']); |
There was a problem hiding this comment.
I think this var can be a const too, no?
| master.on('exit', common.mustCall(code => assert.strictEqual(code, MAGIC_EXIT_CODE))); | ||
|
|
||
| } else if (cluster.isMaster) { | ||
| process.on('uncaughtException', () => process.nextTick(() => process.exit(MAGIC_EXIT_CODE))); |
There was a problem hiding this comment.
I think this is much less readable than the current code.
Correction made to previous commit, correcting a line length restriction.
|
I updated the test file to fix max line errors and edited the arrow function to make it more readable. |
|
Nit: The first line of the commit log should not capitalize anything that isn't an acronym or otherwise requires capitalization. In other words "Refactor" should be "refactor". Wouldn't worry much about changing it right now. Whoever lands the code can change it (as they'll be squashing the multiple commits anyway). Just FYI for subsequent contributions. |
|
LGTM if CI is OK. |
|
The commit title should include the test name to not be confusing. |
jasnell
left a comment
There was a problem hiding this comment.
LGTM, can fix the commit log messages when landing
Replaces function expressions with ES6 arrow functions as well as improve the comparison operator to check if operands are of same types. PR-URL: #9239 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
|
Landed with nits addressed and edited commit long in 383e40b |
Replaces function expressions with ES6 arrow functions as well as improve the comparison operator to check if operands are of same types. PR-URL: #9239 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Replaces function expressions with ES6 arrow functions as well as improve the comparison operator to check if operands are of same types. PR-URL: #9239 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Checklist
make -j8 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
Test
Description of change
This commit replaces function expressions with ES6 arrow
functions as well as improves the comparison operator to
check if operands are of same types.