We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 612ba1a commit 7457093Copy full SHA for 7457093
doc/api/assert.md
@@ -738,12 +738,15 @@ assert.throws(
738
739
Validate error message using [`RegExp`][]:
740
741
+Using a regular expression runs `.toString` on the error object, and will
742
+therefore also include the error name.
743
+
744
```js
745
assert.throws(
746
() => {
747
throw new Error('Wrong value');
748
},
- /value/
749
+ /^Error: Wrong value$/
750
);
751
```
752
0 commit comments