Skip to content

Commit a73dea9

Browse files
rjbernaldoMylesBorins
authored andcommitted
test: add second argument to assert.throws()
Adds a second argument to the assert.throws() test to implicitly specify expected error message. PR-URL: #12016 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
1 parent 837ff4b commit a73dea9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/parallel/test-util-inspect-proxy.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ assert.strictEqual(processUtil.getProxyDetails({}), undefined);
3131
// and the get function on the handler object defined above
3232
// is actually invoked.
3333
assert.throws(
34-
() => util.inspect(proxyObj)
34+
() => util.inspect(proxyObj),
35+
/^Error: Getter should not be called$/
3536
);
3637

3738
// Yo dawg, I heard you liked Proxy so I put a Proxy

0 commit comments

Comments
 (0)