Skip to content

test: simplify tests by using assert.rejects - #27123

Closed
BridgeAR wants to merge 2 commits into
nodejs:masterfrom
BridgeAR:simplify-tests-with-rejects
Closed

test: simplify tests by using assert.rejects#27123
BridgeAR wants to merge 2 commits into
nodejs:masterfrom
BridgeAR:simplify-tests-with-rejects

Conversation

@BridgeAR

@BridgeAR BridgeAR commented Apr 7, 2019

Copy link
Copy Markdown
Member

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 nodejs-github-bot added the test Issues and PRs related to Node.js core tests and test infrastructure. label Apr 7, 2019
@BridgeAR BridgeAR added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Apr 7, 2019
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
Copy Markdown
Member Author

Landed in 3d6533e and 3a6eba3 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. test Issues and PRs related to Node.js core tests and test infrastructure.

6 participants