-
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
test: replace string concatenation in this file with template literals #14270
Conversation
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.
Thanks for contributing! |
const content = require(common.fixturesDir + | ||
'/json-with-directory-name-module/module-stub/one-trailing-slash/two/three.js'); | ||
const filePath = '/json-with-directory-name-module/module-stub/one-trailing-slash/two/three.js'; | ||
const content = require(`${common.fixturesDir}${filePath}`); |
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.
This is Ok.
But it would be much better to use path.join
instead, see #14272 (comment)
You could even do it with multiple parts
const filePath = path.join(
common.fixturesDir,
'json-with-directory-name-module',
'module-stub',
'one-trailing-slash',
'two',
'three.js'
);
Something odd happened with CI so we'll have to re-run it again when the CI server is a little less overwhelmed. |
PR-URL: nodejs#14270 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: David Cai <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
Landed in cf25324 Thanks for the contribution! 🎉 |
PR-URL: #14270 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: David Cai <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
PR-URL: #14270 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: David Cai <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
PR-URL: #14270 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: David Cai <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
PR-URL: #14270 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: David Cai <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
PR-URL: #14270 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: David Cai <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test, require