Skip to content

Commit

Permalink
assert: fix backport regression
Browse files Browse the repository at this point in the history
This fixes a regression for an error case with `assert.rejects` and
`assert.doesNotReject`.

Fixes: nodejs#27185
  • Loading branch information
BridgeAR committed Apr 12, 2019
1 parent d4b6643 commit 7ce9361
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,8 @@ function getActual(block) {

async function waitForActual(block) {
if (typeof block !== 'function') {
throw new errors.ERR_INVALID_ARG_TYPE('block', 'Function', block);
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'block', 'Function',
block);
}

// Return a rejected promise if `block` throws synchronously.
Expand Down

0 comments on commit 7ce9361

Please sign in to comment.