-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
[JsConf Code & Learn]test: replace string concatenation with template literals #14342
Conversation
test/parallel/test-icu-data-dir.js
Outdated
@@ -8,7 +8,7 @@ const { spawnSync } = require('child_process'); | |||
|
|||
const expected = | |||
'could not initialize ICU (check NODE_ICU_DATA or ' + | |||
'--icu-data-dir parameters)' + (common.isWindows ? '\r\n' : '\n'); | |||
`--icu-data-dir parameters)${common.isWindows ? '\r\n' : '\n'}`; |
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.
While you're here, could you replace ${common.isWindows ? '\r\n' : '\n'}
with ${os.EOL}
(you'll have to const os = require('os')
after line 2 as well)?
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.
Actually since expected
is later used with str.includes(expected)
you could remove the EOL completely, and fit the string in a single line.
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.
@gibfahn sure, it will come soon~
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.
@refack Sorry, I can't get your meanings. Do you mean the code afterconst expected ...
to be one line?
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.
@refack means this:
- '--icu-data-dir parameters)' + (common.isWindows ? '\r\n' : '\n');
+ '--icu-data-dir parameters)'
but it was fine as it is (and arguably slightly better).
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.
@nathansmile sorry I missed your comment. But I landed it since it's good. 😄
@nathansmile thank you for the contribution. Hope you follow up on this and make it even better 👍 |
@nathansmile I think @refack meant since |
BTW personally I think we should keep the EOL in |
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.
LGTM if CI is green
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.
LGTM if CI is green
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.
LGTM if CI is green.
PR-URL: nodejs#14342 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Landed in 01eddd9 |
PR-URL: #14342 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
PR-URL: #14342 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
replace string concatenation in test/parallel/test-icu-data-dir.js with template literals
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)