Skip to content
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: change assert message arg from literal to template literal #16843

Closed
wants to merge 4 commits into from

Conversation

markmcnelis
Copy link
Contributor

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Nov 6, 2017
@markmcnelis markmcnelis changed the title Node contribution test: change assert message arg from literal to template literal Nov 6, 2017
@mscdex mscdex added v8 engine Issues and PRs related to the V8 dependency. vm Issues and PRs related to the vm subsystem. labels Nov 6, 2017
Trott
Trott previously requested changes Nov 6, 2017
Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @markmcnelis! Welcome, and thanks for the PR! I have some small changes I hope you can make and then push to your branch (so it will update this PR). Thanks!

@@ -34,17 +34,21 @@ baseFoo = 'foo'; // eslint-disable-line no-undef
global.baseBar = 'bar';

assert.strictEqual(global.baseFoo, 'foo',
'x -> global.x in base level not working');
// eslint-disable-next-line no-undef
`${baseFoo} -> global.baseFoo in base level not
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would result in very confusing message, IMO. I think you might be misunderstanding the original error message text.

Try removing the eslint-disable-line comment that was added and using something like this for the message instead:

`x -> global.x failed: global.baseDir = ${global.baseDir}`


assert.strictEqual(baseBar, // eslint-disable-line no-undef
'bar',
'global.x -> x in base level not working');
// eslint-disable-next-line no-undef
`${global.baseBar} -> baseBar in base level not
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This too will be very confusing: "bar -> baseBar in base level not working"....huh?

Try something like this instead:

`global.x -> x failed: baseBar = ${baseBar}`

@Trott Trott added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Nov 6, 2017
@markmcnelis
Copy link
Contributor Author

Hi @Trott! Thanks for your input. I've made some changes based on your feedback. Please review if you get a chance. Thanks

@gireeshpunathil
Copy link
Member

@Trott Trott dismissed their stale review November 7, 2017 13:36

Looks good to me if the linter doesn't complain and CI is green. Thanks!

Trott pushed a commit to Trott/io.js that referenced this pull request Nov 7, 2017
PR-URL: nodejs#16843
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@Trott
Copy link
Member

Trott commented Nov 7, 2017

Landed in 9468108.
Thanks for the contribution! 🎉

@Trott Trott closed this Nov 7, 2017
evanlucas pushed a commit that referenced this pull request Nov 13, 2017
PR-URL: #16843
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@evanlucas evanlucas mentioned this pull request Nov 13, 2017
MylesBorins pushed a commit that referenced this pull request Nov 17, 2017
PR-URL: #16843
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@gibfahn gibfahn mentioned this pull request Nov 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. test Issues and PRs related to the tests. v8 engine Issues and PRs related to the V8 dependency. vm Issues and PRs related to the vm subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants