Automattic / Automattic/expect.js
Change readme exception example
Open
- Dominant language
- JavaScript
- Stars
- 2.1k
- Forks
- 207
- PR merge metrics
- No merged PRs in 30d
Description
I would change this:
``` javascript
expect(fn).to.throwException(function (e) { // get the exception object
expect(e).to.be.a(SyntaxError);
});
```
to
``` javascript
expect(fn).to.throwException(function (e) { // get the exception object
expect(e.constructor).to.be(SyntaxError);
});
```
to ignore inheritance. It surely depends on the test, but I think that you usually want to test for a specific exception, not a "kind of" exception.
Just a suggestion ... :)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.