Skip to content

Conversation

@bwhitty
Copy link
Contributor

@bwhitty bwhitty commented Oct 6, 2017

Fixes a line of uncovered code in the AsyncWrap class's constructor.
Specifically this covers validtion of the 'promiseResolve' argument.

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
@bwhitty bwhitty force-pushed the async-wrap-constructor-tests branch from 09e5cbc to 06f4599 Compare October 6, 2017 19:12
@bwhitty bwhitty changed the title more AsyncWrap constructor args validation tests test: more AsyncWrap constructor args validation tests Oct 6, 2017
Copy link
Member

@BridgeAR BridgeAR 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

Fixes a line of uncovered code in the AsyncWrap class's constructor.
Specifically this covers validtion of the 'promiseResolve' argument.
@bwhitty bwhitty force-pushed the async-wrap-constructor-tests branch from 06f4599 to 34b993f Compare October 6, 2017 23:15
@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
@refack refack self-assigned this Oct 10, 2017
@joyeecheung
Copy link
Member

@lance
Copy link
Member

lance commented Oct 13, 2017

Appears to be a linting error.

not ok 17 - /usr/home/iojs/build/workspace/node-test-linter/test/parallel/test-async-wrap-constructor.js
  ---
  message: Line 10 exceeds the maximum line length of 80.
  severity: error
  data:
    line: 10
    column: 1
    ruleId: max-len
  ...
+ exit 1

@bwhitty can you change the offending line to be fewer than 80 characters?

Maybe something like.

  for (const field of
    ['init', 'before', 'after', 'destroy', 'promiseResolve']) {

You can validate your changes without having to run the full test suite by running

$ make lint-js

Thanks for the contribution!


for (const badArg of [0, 1, false, true, null, 'hello']) {
for (const field of ['init', 'before', 'after', 'destroy']) {
for (const field of ['init', 'before', 'after', 'destroy', 'promiseResolve']) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Another passible way to reduce line length:

  const hookNames = ['init', 'before', 'after', 'destroy', 'promiseResolve'];
  for (const field of hookNames) {

@bwhitty
Copy link
Contributor Author

bwhitty commented Oct 16, 2017

My bad, should have ran the linter locally first! Line length issue fixed!

@joyeecheung
Copy link
Member

@BridgeAR BridgeAR assigned BridgeAR and unassigned refack Oct 18, 2017
BridgeAR pushed a commit that referenced this pull request Oct 19, 2017
Fixes a line of uncovered code in the AsyncWrap class's constructor.
Specifically this covers validtion of the 'promiseResolve' argument.

PR-URL: #16025
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
@BridgeAR
Copy link
Member

Landed in ba999e1

Thanks for the PR, and congratulations on becoming a Node.js Contributor 🎉 !

@BridgeAR BridgeAR closed this Oct 19, 2017
MylesBorins pushed a commit that referenced this pull request Oct 23, 2017
Fixes a line of uncovered code in the AsyncWrap class's constructor.
Specifically this covers validtion of the 'promiseResolve' argument.

PR-URL: #16025
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
addaleax pushed a commit to ayojs/ayo that referenced this pull request Oct 26, 2017
Fixes a line of uncovered code in the AsyncWrap class's constructor.
Specifically this covers validtion of the 'promiseResolve' argument.

PR-URL: nodejs/node#16025
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
addaleax pushed a commit to ayojs/ayo that referenced this pull request Dec 7, 2017
Fixes a line of uncovered code in the AsyncWrap class's constructor.
Specifically this covers validtion of the 'promiseResolve' argument.

PR-URL: nodejs/node#16025
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.