| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| assert.strictEqual(count, messages.length, | ||
| 'A worker received an invalid multicast message'); | ||
| `A worker received an invalid multicast message: | ||
| Recieved ${messages.length}, should be ${count}`); |
There was a problem hiding this comment.
Recieved -> Received
Sorry, something went wrong.
There was a problem hiding this comment.
Using multiline template strings is actually discouraged. This would add lots of extra whitespace to the error message. Please use this instead
'A worker received an invalid multicast message' +
`Received ${messages.length}, should be ${count}`
Sorry, something went wrong.
There was a problem hiding this comment.
Thank you! I didn't know about that, we do try to keep messages very short in our code base at work so I didn't know how to handle longer strings! Will fix!
Sorry, something went wrong.
|
Oh dear...I get caught by that 'i before e' rule when typing all the time! Thank you for the catch! |
Sorry, something went wrong.
| assert.strictEqual(count, messages.length, | ||
| 'A worker received an invalid multicast message'); | ||
| 'A worker received an invalid multicast message' + | ||
| `Received ${messages.length}, should be ${count}`); |
There was a problem hiding this comment.
If I'm not wrong it should be the opposite: Received ${count}, should be ${messages.length}.
I also think it makes sense to remove the error message in favor of the default one.
Sorry, something went wrong.
There was a problem hiding this comment.
I thought count is the expected number and messages.length is the actual number recieved? I'm actually away from my computer until the 23rd (on vacation!) So I can't take a look until then! But I agree taking out the error message would be a good idea!
Sorry, something went wrong.
There was a problem hiding this comment.
No, it is actually the other way around.
Sorry, something went wrong.
There was a problem hiding this comment.
Even if reversed the message is still misleading as the assertion is actually run when all messages are received by all workers, so my suggestion is to get rid of the message argument completely and use the default error message.
assert.strictEqual(count, messages.length);
Sorry, something went wrong.
There was a problem hiding this comment.
See #15998 (comment). It's the same here.
Sorry, something went wrong.
|
I went and fixed the nit from @lpinca. I think this is ready to go. PTAL. |
Sorry, something went wrong.
Sorry, something went wrong.
PR-URL: #15979 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
PR-URL: #15979 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
PR-URL: #15979 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
PR-URL: #15979 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
PR-URL: nodejs/node#15979 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
PR-URL: nodejs/node#15979 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
PR-URL: #15979 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
PR-URL: #15979 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
PR-URL: #15979 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
PR-URL: nodejs/node#15979 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
| Back | FazBrowse Home | New Git URL |
Checklist
Affected core subsystem(s)