GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||
GeezerVison is showing github.com — [v12.x backport] test: refactor common.expectsError by sxa · Pull Request #31449 · nodejs/node Conversation
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
https://ci.nodejs.org/job/node-test-commit-linux/nodes=centos7-64-gcc6/32389/consoleFull (Thanks @BethGriggs for kicking it off) failed the PR test job due to the failure shown below with |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
44a6565 to
9f59f39
Compare
|
All comments addressed @BridgeAR if you want to take another look. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
This passed although doesn't include my latest (minor) tweak to address review comments |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
9f59f39 to
a7afcbb
Compare
|
I've rebased against v12.x to fixed conflicts. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
67ec97a to
fc7b27e
Compare
a01fb4a to
e5dc2fb
Compare
63a03d2 to
d577190
Compare
This completely refactors the `expectsError` behavior: so far it's almost identical to `assert.throws(fn, object)` in case it was used with a function as first argument. It had a magical property check that allowed to verify a functions `type` in case `type` was passed used in the validation object. This pattern is now completely removed and `assert.throws()` should be used instead. The main intent for `common.expectsError()` is to verify error cases for callback based APIs. This is now more flexible by accepting all validation possibilites that `assert.throws()` accepts as well. No magical properties exist anymore. This reduces surprising behavior for developers who are not used to the Node.js core code base. This has the side effect that `common` is used significantly less frequent. Backport-PR-URL: nodejs#31449 PR-URL: nodejs#31092 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
|
rebased |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
CI: https://ci.nodejs.org/job/node-test-pull-request/30315/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
This completely refactors the `expectsError` behavior: so far it's almost identical to `assert.throws(fn, object)` in case it was used with a function as first argument. It had a magical property check that allowed to verify a functions `type` in case `type` was passed used in the validation object. This pattern is now completely removed and `assert.throws()` should be used instead. The main intent for `common.expectsError()` is to verify error cases for callback based APIs. This is now more flexible by accepting all validation possibilites that `assert.throws()` accepts as well. No magical properties exist anymore. This reduces surprising behavior for developers who are not used to the Node.js core code base. This has the side effect that `common` is used significantly less frequent. Backport-PR-URL: #31449 PR-URL: #31092 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
|
landed in d568efc |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks @MylesBorins - I hadn't got back to doing the rebase after the release went out as it looked rather non-trivial to redo with the modified history on this one, but should be a good one to get in. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@sxa555 it is landed and in! FWIW I made a new branch off of staging and cherry-picked your initial commit (rather than rebasing). There was only a single conflict, so it was rather straight forward all things considered |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.