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: show pending exception error in napi tests #18413

Closed
wants to merge 2 commits into from
Closed

test: show pending exception error in napi tests #18413

wants to merge 2 commits into from

Conversation

reccanti
Copy link
Contributor

Shows the result of the wasPending in the error message if the
assertion fails.

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

Shows the result of the wasPending in the error message if the
assertion fails.
@nodejs-github-bot nodejs-github-bot added dont-land-on-v4.x node-api Issues and PRs related to the Node-API. test Issues and PRs related to the tests. labels Jan 27, 2018
const exception_pending = test_exception.wasPending();
assert.strictEqual(exception_pending, true,
'Expected exception to be pending, but' +
`it was marked as ${exception_pending}`);
Copy link
Member

Choose a reason for hiding this comment

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

I think this change might be more confusing than helpful. Is "marked as false" going to help someone or confuse them?

How about this:

`Exception not pending as expected, .wasPending() returned ${exception_pending}`

const exception_pending = test_exception.wasPending();
assert.strictEqual(exception_pending, false,
'Expected no exception to be pending, but' +
` it was marked as ${exception_pending}`);
Copy link
Member

Choose a reason for hiding this comment

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

Same comment as above, although with the text changed to reverse the expectation.

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.

Thanks for the pull request. It's close, I think, but I'd like to see the text improved a little bit. What do you think?

Updated the error message for pending exceptions so that it was a bit
more clear.
@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 31, 2018
@BridgeAR
Copy link
Member

@reccanti
Copy link
Contributor Author

@Trott Thanks for the feedback, I wasn't quite sure what to put there. I updated the error messages. How do they look?

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. Thanks for the pull request!

@BridgeAR
Copy link
Member

BridgeAR commented Feb 1, 2018

Landed in 0c16b18

@BridgeAR BridgeAR closed this Feb 1, 2018
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Feb 1, 2018
Shows the result of the wasPending in the error message if the
assertion fails.

PR-URL: nodejs#18413
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
@addaleax addaleax removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 4, 2018
MylesBorins pushed a commit that referenced this pull request Feb 20, 2018
Shows the result of the wasPending in the error message if the
assertion fails.

PR-URL: #18413
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
MylesBorins pushed a commit that referenced this pull request Feb 21, 2018
Shows the result of the wasPending in the error message if the
assertion fails.

PR-URL: #18413
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
MylesBorins pushed a commit that referenced this pull request Feb 21, 2018
Shows the result of the wasPending in the error message if the
assertion fails.

PR-URL: #18413
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Feb 21, 2018
gabrielschulhof pushed a commit to gabrielschulhof/node that referenced this pull request Apr 12, 2018
Shows the result of the wasPending in the error message if the
assertion fails.

PR-URL: nodejs#18413
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
gabrielschulhof pushed a commit to gabrielschulhof/node that referenced this pull request Apr 16, 2018
Shows the result of the wasPending in the error message if the
assertion fails.

PR-URL: nodejs#18413
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
MylesBorins pushed a commit that referenced this pull request Apr 16, 2018
Shows the result of the wasPending in the error message if the
assertion fails.

Backport-PR-URL: #19447
PR-URL: #18413
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Apr 16, 2018
MylesBorins pushed a commit that referenced this pull request May 1, 2018
Shows the result of the wasPending in the error message if the
assertion fails.

Backport-PR-URL: #19265
PR-URL: #18413
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
@MylesBorins MylesBorins mentioned this pull request May 2, 2018
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
Shows the result of the wasPending in the error message if the
assertion fails.

PR-URL: nodejs#18413
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
node-api Issues and PRs related to the Node-API. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants