Uh oh!
There was an error while loading. Please reload this page.
assert: validate the block return type - #19886
Closed
BridgeAR wants to merge 2 commits into
Closed
Conversation
jasnell
approved these changes
Apr 9, 2018
targos
reviewed
Apr 9, 2018
MemberAuthor
There was a problem hiding this comment.
This is a change from #19885 that I plan on removing in here as soon as that lands. I already fixed that in there though.
4 tasks
This makes sure the returned value when calling `block` is actually of type promise in case `assert.rejects` or `assert.doesNotReject` is called.
BridgeARforce-pushed
the
stricter-assert-rejects
branch
from
April 16, 2018 02:14
8fdc532 to
386f664CompareBridgeAR
commented
Apr 16, 2018
MemberAuthor
BridgeAR
commented
Apr 16, 2018
MemberAuthor
Rebased. This is unblocked and should now be looked at. |
BridgeAR
commented
Apr 19, 2018
MemberAuthor
@targos PTAL |
targos
approved these changes
Apr 19, 2018
| rejected Promise with an [`ERR_INVALID_RETURN_VALUE`][] error. In both cases | ||
| without checking the error handler. | ||
| If `block` is a function and it does not return a promise, an |
Member
There was a problem hiding this comment.
Isn't this redundant with the previous paragraph?
| <a id="ERR_INVALID_RETURN_VALUE"></a> | ||
| ### ERR_INVALID_RETURN_VALUE | ||
| Thrown in case a function option does not return a expected value on execution. |
| `assert.doesNotReject()` will return a rejected Promise with that error. If the | ||
| function does not return a promise, `assert.doesNotReject()` will return a | ||
| rejected Promise with an [`ERR_INVALID_RETURN_VALUE`][] error. In both cases | ||
| without checking the error handler. |
Contributor
There was a problem hiding this comment.
This sentence fragment seems a bit unexpected. Should we add a verb to it?
| `assert.rejects()` will return a rejected Promise with that error without | ||
| `assert.rejects()` will return a rejected Promise with that error. If the | ||
| function does not return a promise, `assert.rejects()` will return a rejected | ||
| Promise with an [`ERR_INVALID_RETURN_VALUE`][] error. In both cases without |
BridgeAR
commented
Apr 19, 2018
MemberAuthor
Comments addressed. |
BridgeAR
commented
Apr 19, 2018
MemberAuthor
@vsemozhetbyt@targos PTAL. This should be ready to land otherwise. |
BridgeAR added a commit
to BridgeAR/node
that referenced
this pull request
Apr 19, 2018
This makes sure the returned value when calling `block` is actually of type promise in case `assert.rejects` or `assert.doesNotReject` is called. PR-URL: nodejs#19886 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
BridgeAR
commented
Apr 19, 2018
MemberAuthor
Landed in 7007eee |
jasnell pushed a commit
that referenced
this pull request
Apr 20, 2018
This makes sure the returned value when calling `block` is actually of type promise in case `assert.rejects` or `assert.doesNotReject` is called. PR-URL: #19886 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes sure the returned value when calling
blockis actuallyof type promise in case
assert.rejectsorassert.doesNotRejectis called.
This currently relies on #19885 and I am going to rebase as soon as that lands / changes. Marking as blocked in the meanwhile.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes