Skip to content

test: simplify tests by using assert.rejects #27123

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 2 commits into from

Conversation

BridgeAR
Copy link
Member

@BridgeAR BridgeAR commented Apr 7, 2019

Please check the commit descriptions for details.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

BridgeAR added 2 commits April 7, 2019 18:32
Use `assert.rejects` to test error cases. This simplifies the test.
This verifies that the test actually rejects at this point by using
`assert.rejects` instead of `try / catch`.
@BridgeAR BridgeAR requested a review from devsnek April 7, 2019 16:46
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Apr 7, 2019
@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 7, 2019
@nodejs-github-bot
Copy link
Collaborator

BridgeAR added a commit to BridgeAR/node that referenced this pull request Apr 10, 2019
Use `assert.rejects` to test error cases. This simplifies the test.

PR-URL: nodejs#27123
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
BridgeAR added a commit to BridgeAR/node that referenced this pull request Apr 10, 2019
This verifies that the test actually rejects at this point by using
`assert.rejects` instead of `try / catch`.

PR-URL: nodejs#27123
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
@BridgeAR
Copy link
Member Author

Landed in 3d6533e and 3a6eba3 🎉

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants