Skip to content

Commit

Permalink
Added docs for throwException fn/regexp signatures.
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Feb 4, 2012
1 parent d38dfc2 commit 7109b68
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Expand Up @@ -128,10 +128,14 @@ expect({ a: 'b', c: 'd' }).to.only.have.keys(['a', 'c']);
expect({ a: 'b', c: 'd' }).to.not.only.have.key('a');
```

**throwException**: asserts that the `Function` throws or not when called
**throwException**/**throwError**: asserts that the `Function` throws or not when called

```js
expect(fn).to.throwException();
expect(fn).to.throwError(); // synonym of throwException
expect(fn).to.throwException(function (e) { // get the exception object
expect(e).to.be.a(SyntaxError);
});
expect(fn).to.throwException(/matches the exception message/);
expect(fn2).to.not.throwException();
```

Expand Down

0 comments on commit 7109b68

Please sign in to comment.