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: use assert regexp in tls no cert test #12891

Closed
wants to merge 1 commit into from

Conversation

@arturgvieira
Copy link
Contributor

commented May 8, 2017

Replace the assert throws second argument from a contructor to a regexp
matching the entire error message.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test tls

@mscdex mscdex added the tls label May 8, 2017

@refack
refack approved these changes May 8, 2017
@refack

This comment has been minimized.

Copy link
Member

commented May 8, 2017

@arturgvieira thank you very much for the contribution 🥇

@Trott
Trott approved these changes May 8, 2017
Copy link
Member

left a comment

LGTM if CI is green.

Might be nice to put the regexp on its own line to keep everything to 80 chars or less. Not required, though. (When it eventually gets replaced with common.expectsError(), it will get wrapped at that time, so I'm not going to sweat it.)

@arturgvieira

This comment has been minimized.

Copy link
Contributor Author

commented May 8, 2017

@Trott Thanks for the opportunity @refack glad to help

I can wrap it if it's preferred.

@cjihrig
cjihrig approved these changes May 8, 2017
Copy link
Contributor

left a comment

LGTM with a style nit.

test/parallel/test-tls-no-cert-required.js Outdated
@@ -41,7 +41,8 @@ tls.createServer(assert.fail)
tls.createServer({})
.listen(0, common.mustCall(close));

assert.throws(() => tls.createServer('this is not valid'), TypeError);
assert.throws(() => tls.createServer('this is not valid'),
/^TypeError: options must be an object$/);

This comment has been minimized.

Copy link
@cjihrig

cjihrig May 8, 2017

Contributor

Can you indent this please.

@arturgvieira

This comment has been minimized.

Copy link
Contributor Author

commented May 8, 2017

@cjihrig Just fixed it.

@DavidCai1993

This comment has been minimized.

@lpinca
lpinca approved these changes May 8, 2017
@lpinca

This comment has been minimized.

Copy link
Member

commented May 8, 2017

@arturgvieira can you please run make lint and fix the errors?
Thank you.

@arturgvieira

This comment has been minimized.

Copy link
Contributor Author

commented May 8, 2017

@lpinca Fixed the lint error, trailing spaces.

@lpinca

This comment has been minimized.

Copy link
Member

commented May 8, 2017

@refack

This comment has been minimized.

Copy link
Member

commented May 8, 2017

Rerun macOS CI:https://ci.nodejs.org/job/node-test-commit-osx/9635/
(failure was a timeout, most probably unrelated.

@refack refack self-assigned this May 8, 2017

@jasnell
jasnell approved these changes May 9, 2017
test: use assert regexp in tls no cert test
Replace the assert throws second argument from a contructor to a regexp
matching the entire error message.

@arturgvieira arturgvieira changed the title test: replace assert throws message with a regexp test: use assert regexp in tls no cert test May 10, 2017

refack added a commit to refack/node that referenced this pull request May 10, 2017
test: use assert regexp in tls no cert test
Replace the `assert.throws` second argument from a Type to a `RegExp`
matching the entire error message.
Error message changes are `semver-major`, so we assert their content.

PR-URL: nodejs#12891
Refs: nodejs#12603
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Cai <davidcai1993@yahoo.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@refack

This comment has been minimized.

Copy link
Member

commented May 10, 2017

Landed in cfe7b34

@refack refack closed this May 10, 2017

@refack

This comment has been minimized.

Copy link
Member

commented May 10, 2017

Post land CI:https://ci.nodejs.org/job/node-test-commit/9785/
(Since the CI is on master the one CI job covers three small lands I did almost together.)

anchnk pushed a commit to anchnk/node that referenced this pull request May 19, 2017
test: use assert regexp in tls no cert test
Replace the `assert.throws` second argument from a Type to a `RegExp`
matching the entire error message.
Error message changes are `semver-major`, so we assert their content.

PR-URL: nodejs#12891
Refs: nodejs#12603
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Cai <davidcai1993@yahoo.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell jasnell referenced this pull request May 28, 2017
@gibfahn gibfahn referenced this pull request Jun 15, 2017
2 of 3 tasks complete
gibfahn added a commit that referenced this pull request Jun 20, 2017
test: use assert regexp in tls no cert test
Replace the `assert.throws` second argument from a Type to a `RegExp`
matching the entire error message.
Error message changes are `semver-major`, so we assert their content.

PR-URL: #12891
Refs: #12603
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Cai <davidcai1993@yahoo.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins added a commit that referenced this pull request Jul 11, 2017
test: use assert regexp in tls no cert test
Replace the `assert.throws` second argument from a Type to a `RegExp`
matching the entire error message.
Error message changes are `semver-major`, so we assert their content.

PR-URL: #12891
Refs: #12603
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Cai <davidcai1993@yahoo.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins referenced this pull request Jul 18, 2017

@refack refack removed their assignment Oct 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.