-
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 the code in test-process-hrtime #10667
Conversation
@@ -12,16 +12,16 @@ validateTuple(tuple); | |||
validateTuple(process.hrtime(tuple)); | |||
|
|||
// test that only an Array may be passed to process.hrtime() | |||
assert.throws(function() { | |||
assert.throws(() => { | |||
process.hrtime(1); | |||
}); | |||
|
|||
function validateTuple(tuple) { | |||
assert(Array.isArray(tuple)); | |||
assert.equal(2, tuple.length); |
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.
can you also make this one strictEqual and in the correct order?
sorry @targos , missed that one... changed it now |
It would be great if the |
* use const instead of var * use assert.strictEqual instead of assert.equal and plain assert * use arrow functions * swap assertions arguments to match the standard * validate the error for assert.throws
Thanks @Trott, just added it as suggested and will have in mind from now on |
* use const instead of var * use assert.strictEqual instead of assert.equal and plain assert * use arrow functions * swap assertions arguments to match the standard * validate the error for assert.throws PR-URL: #10667 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michal Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Landed in 2685464 |
* use const instead of var * use assert.strictEqual instead of assert.equal and plain assert * use arrow functions * swap assertions arguments to match the standard * validate the error for assert.throws PR-URL: nodejs#10667 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michal Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
* use const instead of var * use assert.strictEqual instead of assert.equal and plain assert * use arrow functions * swap assertions arguments to match the standard * validate the error for assert.throws PR-URL: nodejs#10667 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michal Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
* use const instead of var * use assert.strictEqual instead of assert.equal and plain assert * use arrow functions * swap assertions arguments to match the standard * validate the error for assert.throws PR-URL: nodejs#10667 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michal Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
* use const instead of var * use assert.strictEqual instead of assert.equal and plain assert * use arrow functions * swap assertions arguments to match the standard * validate the error for assert.throws PR-URL: nodejs#10667 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michal Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
* use const instead of var * use assert.strictEqual instead of assert.equal and plain assert * use arrow functions * swap assertions arguments to match the standard * validate the error for assert.throws PR-URL: #10667 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michal Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
This test fails on v4.x and has not been backported |
* use const instead of var * use assert.strictEqual instead of assert.equal and plain assert * use arrow functions * swap assertions arguments to match the standard * validate the error for assert.throws PR-URL: #10667 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michal Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test