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
Closed

test: use assert regexp in tls no cert test #12891

wants to merge 1 commit into from

Conversation

arturgvieira-zz
Copy link

@arturgvieira-zz arturgvieira-zz 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

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label May 8, 2017
@mscdex mscdex added the tls Issues and PRs related to the tls subsystem. label May 8, 2017
@refack
Copy link
Contributor

refack commented May 8, 2017

@arturgvieira thank you very much for the contribution 🥇

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.

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-zz
Copy link
Author

arturgvieira-zz commented May 8, 2017

@Trott Thanks for the opportunity @refack glad to help

I can wrap it if it's preferred.

Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

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

LGTM with a style nit.

@@ -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$/);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you indent this please.

@arturgvieira-zz
Copy link
Author

@cjihrig Just fixed it.

@DavidCai1111
Copy link
Member

@lpinca
Copy link
Member

lpinca commented May 8, 2017

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

@arturgvieira-zz
Copy link
Author

arturgvieira-zz commented May 8, 2017

@lpinca Fixed the lint error, trailing spaces.

@lpinca
Copy link
Member

lpinca commented May 8, 2017

@refack
Copy link
Contributor

refack 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
Replace the assert throws second argument from a contructor to a regexp
matching the entire error message.
@arturgvieira-zz arturgvieira-zz changed the title test: replace assert throws message with a regexp test: use assert regexp in tls no cert test May 10, 2017
refack pushed a commit to refack/node that referenced this pull request May 10, 2017
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 <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: David Cai <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@refack
Copy link
Contributor

refack commented May 10, 2017

Landed in cfe7b34

@refack refack closed this May 10, 2017
@refack
Copy link
Contributor

refack 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
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 <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: David Cai <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@jasnell jasnell mentioned this pull request May 28, 2017
@gibfahn gibfahn mentioned this pull request Jun 15, 2017
3 tasks
gibfahn pushed a commit that referenced this pull request Jun 20, 2017
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 <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: David Cai <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jul 11, 2017
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 <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: David Cai <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@MylesBorins MylesBorins mentioned 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
Labels
test Issues and PRs related to the tests. tls Issues and PRs related to the tls subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.