Skip to content

Commit

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

Fixes: #27185

PR-URL: #27202
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
  • Loading branch information
BridgeAR authored and MylesBorins committed Apr 16, 2019
1 parent eaf474c commit 705935d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/assert.js
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 705935d

Please sign in to comment.