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: cleanup test-utils-inherits.js #12602

Closed

Conversation

RobotMermaid
Copy link
Contributor

Replaced constructor with regular expression for assert.throw().

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)

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Apr 22, 2017
@bengl bengl added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Apr 22, 2017
@vsemozhetbyt
Copy link
Contributor

@mscdex mscdex added the util Issues and PRs related to the built-in util module. label Apr 22, 2017
@mscdex
Copy link
Contributor

mscdex commented Apr 22, 2017

Commit message should say 'test-util-inherits' (singular).

Replaced constructor with regular expression for assert.throw().
@Trott
Copy link
Member

Trott commented Apr 23, 2017

Linux CI issues are unrelated. CI looks good.

}, /^TypeError: The super constructor to "inherits" must have a prototype$/);
assert.throws(function() {
inherits(A, null);
}, /^TypeError: The super constructor to "inherits" must not be null or undefined$/); // eslint-disable-line max-len
Copy link
Member

Choose a reason for hiding this comment

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

Long line here. Lines should not be longer than 80 chars

Copy link
Member

Choose a reason for hiding this comment

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

Specifically, I know this inlines the eslint rule, but this can be reworked to avoid that entirely...

const errCheck =
  new RegExp('^TypeError: The super constructor to "inherits" must not be ' +
                      'null or undefined$');
assert.throws(() => inherits(A, null), errCheck);

Replaced constructor with regular expression for assert.throw().
Replaced constructor with regular expression for assert.throw().
@Trott
Copy link
Member

Trott commented Apr 26, 2017

@Trott
Copy link
Member

Trott commented Apr 27, 2017

@Trott
Copy link
Member

Trott commented Apr 27, 2017

GitHub reports no merge conflict but CI can't do a checkout because of a merge conflict. I think I've seen this before with a merge commit or something? Anyone remember what's going on? @nodejs/build

@addaleax
Copy link
Member

@Trott I think the issue is that when squashed together, the commits here don’t generate a merge conflict, but the partial ones do.

I think this is good as-is, the only change since the last CI seems to be moving code around for linting, and this isn’t a platform-dependent test anyway.

@addaleax
Copy link
Member

Landed in 2055fd3, thank you a lot for the PR!

@addaleax addaleax closed this Apr 27, 2017
addaleax pushed a commit that referenced this pull request Apr 27, 2017
Replaced constructor with regular expression for assert.throw().

PR-URL: #12602
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@evanlucas evanlucas mentioned this pull request May 1, 2017
evanlucas pushed a commit that referenced this pull request May 1, 2017
Replaced constructor with regular expression for assert.throw().

PR-URL: #12602
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
evanlucas pushed a commit that referenced this pull request May 2, 2017
Replaced constructor with regular expression for assert.throw().

PR-URL: #12602
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
evanlucas pushed a commit that referenced this pull request May 2, 2017
Replaced constructor with regular expression for assert.throw().

PR-URL: #12602
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
gibfahn pushed a commit that referenced this pull request May 15, 2017
Replaced constructor with regular expression for assert.throw().

PR-URL: #12602
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@MylesBorins MylesBorins mentioned this pull request May 23, 2017
andrew749 pushed a commit to michielbaird/node that referenced this pull request Jul 19, 2017
Replaced constructor with regular expression for assert.throw().

PR-URL: nodejs/node#12602
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
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. test Issues and PRs related to the tests. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.