summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/parallel/test-assert.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js
index cf80cf598d..32b2bca641 100644
--- a/test/parallel/test-assert.js
+++ b/test/parallel/test-assert.js
@@ -44,6 +44,19 @@ assert.ok(a.AssertionError.prototype instanceof Error,
assert.throws(() => a(false), a.AssertionError, 'ok(false)');
assert.throws(() => a.ok(false), a.AssertionError, 'ok(false)');
+// Throw message if the message is instanceof Error.
+{
+ let threw = false;
+ try {
+ assert.ok(false, new Error('ok(false)'));
+ } catch (e) {
+ threw = true;
+ assert.ok(e instanceof Error);
+ }
+ assert.ok(threw, 'Error: ok(false)');
+}
+
+
a(true);
a('test', 'ok(\'test\')');
a.ok(true);