unexpected
Version:
Extensible BDD assertion toolkit
20 lines (14 loc) • 396 B
Markdown
Asserts that an Error instance has a given message:
```javascript
expect(new Error('foobar'), 'to have message', 'foobar');
```
In case of a failing expectation you get the following output:
```javascript
expect(new Error('foobar'), 'to have message', 'barfoo');
```
```output
expected Error('foobar') to have message 'barfoo'
expected 'foobar' to satisfy 'barfoo'
-foobar
+barfoo
```