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: replace assert messages with template strings #15996

Closed

Conversation

nhoel
Copy link
Contributor

@nhoel nhoel commented Oct 6, 2017

Specifically for the test-crypto-hash.js test file.

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 Oct 6, 2017
@mscdex mscdex added the crypto Issues and PRs related to the crypto subsystem. label Oct 6, 2017
);
}
assert.strictEqual(a1, '8308651804facb7b9af8ffc53a33a22d6a1c8ac2', 'Test SHA1');
cryptoType = 'md5'; digest = 'hex';
Copy link
Member

Choose a reason for hiding this comment

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

Please always use a new line for these assignments.

assert.strictEqual(a1, '8308651804facb7b9af8ffc53a33a22d6a1c8ac2', 'Test SHA1');
cryptoType = 'md5'; digest = 'hex';
assert.strictEqual(a1, '8308651804facb7b9af8ffc53a33a22d6a1c8ac2',
`${cryptoType} with ${digest} digest failed to evaluate to expected hash value.`);
Copy link
Member

Choose a reason for hiding this comment

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

The line length exceeds 80 characters.

@Trott Trott added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Oct 7, 2017
@hiroppy
Copy link
Member

hiroppy commented Oct 17, 2017

/cc @nodejs/crypto

@BridgeAR
Copy link
Member

@nhoel congratulations on your first PR to Node.js! Right now this will need some further work before it can be merged though. Do you want to follow up on this?

Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

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

With the exception of the formatting nits, the code changes LGTM. The formatting needs to be fixed before it can land, however.

Copy link
Member

@apapirovski apapirovski left a comment

Choose a reason for hiding this comment

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

Hi @nhoel, thank you for trying to improve Node.js! It looks like there are still some oustanding stylistic issues that will get flagged by the linter. Could you try running make lint-js or vcbuild.bat lint-js (Windows) and fix everything it reports? See our contributing guide for more info: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#the-process-of-making-changes

Nhoel S and others added 3 commits October 27, 2017 09:32
@Trott Trott force-pushed the node_workshop01_test_crypto_hassh_js branch from bdc8a97 to 072086c Compare October 27, 2017 16:35
@Trott
Copy link
Member

Trott commented Oct 27, 2017

I went ahead and fixed the lint errors. PTAL.

CI: https://ci.nodejs.org/job/node-test-pull-request/11022/

Copy link
Member

@joyeecheung joyeecheung left a comment

Choose a reason for hiding this comment

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

Would be great to put the tests in blocks, can be done in another PR

Copy link
Member

@tniessen tniessen left a comment

Choose a reason for hiding this comment

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

The introduction of cryptoType and digest appears to be unncessary unless someone DRYs the code up.

@tniessen
Copy link
Member

CI failures are unrelated.

@tniessen
Copy link
Member

Landed in 4eaf1fc.

@tniessen tniessen closed this Oct 28, 2017
tniessen pushed a commit that referenced this pull request Oct 28, 2017
Specifically for the test-crypto-hash.js test file.

PR-URL: #15996
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
gibfahn pushed a commit that referenced this pull request Oct 30, 2017
Specifically for the test-crypto-hash.js test file.

PR-URL: #15996
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
gibfahn pushed a commit that referenced this pull request Oct 30, 2017
Specifically for the test-crypto-hash.js test file.

PR-URL: #15996
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
gibfahn pushed a commit that referenced this pull request Oct 31, 2017
Specifically for the test-crypto-hash.js test file.

PR-URL: #15996
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
@gibfahn gibfahn mentioned this pull request Oct 31, 2017
Qard pushed a commit to ayojs/ayo that referenced this pull request Nov 2, 2017
Specifically for the test-crypto-hash.js test file.

PR-URL: nodejs/node#15996
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Qard pushed a commit to ayojs/ayo that referenced this pull request Nov 2, 2017
Specifically for the test-crypto-hash.js test file.

PR-URL: nodejs/node#15996
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
MylesBorins pushed a commit that referenced this pull request Nov 16, 2017
Specifically for the test-crypto-hash.js test file.

PR-URL: #15996
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
@MylesBorins MylesBorins mentioned this pull request Nov 21, 2017
MylesBorins pushed a commit that referenced this pull request Nov 21, 2017
Specifically for the test-crypto-hash.js test file.

PR-URL: #15996
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
MylesBorins pushed a commit that referenced this pull request Nov 28, 2017
Specifically for the test-crypto-hash.js test file.

PR-URL: #15996
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
addaleax pushed a commit to ayojs/ayo that referenced this pull request Dec 7, 2017
Specifically for the test-crypto-hash.js test file.

PR-URL: nodejs/node#15996
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.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. crypto Issues and PRs related to the crypto subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.