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: removed literal from assert #16805

Closed
wants to merge 3 commits into from

Conversation

awegrzyn
Copy link
Contributor

@awegrzyn awegrzyn commented Nov 6, 2017

Removed literal from assert to display default message.

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
@awegrzyn awegrzyn mentioned this pull request Nov 6, 2017
3 tasks
@apapirovski apapirovski added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Nov 6, 2017
@mscdex
Copy link
Contributor

mscdex commented Nov 6, 2017

I'm not sure that removing this allows for a more helpful error message.

@mscdex mscdex added the module Issues and PRs related to the module subsystem. label Nov 6, 2017
@Trott
Copy link
Member

Trott commented Nov 6, 2017

I'm not sure that removing this allows for a more helpful error message.

@mscdex How about we restore the error message but also include c.value in the message? (I probably suggested they simply remove the message. Whoops, I guess.)

@awegrzyn Can you change it to something like this?:

assert.strictEqual(
  c.value,
  42,
  `require(".") should honor NODE_PATH; expected 42, found ${c.value}`
);

@@ -15,4 +15,4 @@ m._initPaths();

const c = require('.');

assert.strictEqual(c.value, 42, 'require(".") should honor NODE_PATH');
assert.strictEqual(c.value, 42, `require(".") should honor NODE_PATH; expected 42, found ${c.value}`);
Copy link
Member

Choose a reason for hiding this comment

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

this line will be well beyond 80 chars. Can you please format it ? hint: follow @Trott 's suggestion

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM

@Trott
Copy link
Member

Trott commented Nov 8, 2017

Trott pushed a commit to Trott/io.js that referenced this pull request Nov 8, 2017
Include the value that differed from the expected value in an assertion
message in test-require-dot.

PR-URL: nodejs#16805
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@Trott
Copy link
Member

Trott commented Nov 8, 2017

Landed in d520059.
Thanks for the contribution! 🎉

@Trott Trott closed this Nov 8, 2017
evanlucas pushed a commit that referenced this pull request Nov 13, 2017
Include the value that differed from the expected value in an assertion
message in test-require-dot.

PR-URL: #16805
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@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
Include the value that differed from the expected value in an assertion
message in test-require-dot.

PR-URL: #16805
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 17, 2017
Include the value that differed from the expected value in an assertion
message in test-require-dot.

PR-URL: #16805
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@gibfahn gibfahn mentioned this pull request Nov 21, 2017
@MylesBorins MylesBorins mentioned this pull request Nov 21, 2017
MylesBorins pushed a commit that referenced this pull request Nov 21, 2017
Include the value that differed from the expected value in an assertion
message in test-require-dot.

PR-URL: #16805
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 28, 2017
Include the value that differed from the expected value in an assertion
message in test-require-dot.

PR-URL: #16805
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
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. module Issues and PRs related to the module subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants