Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ expect({ a: 'b', c: 'd' }).to.not.only.have.key('a');
**throwException**/**throwError**: asserts that the `Function` throws or not when called

```js
expect(fn).to.throwError(); // synonym of throwException
expect(fn).to.throwException(function (e) { // get the exception object
expect( function(){ MyFunction(undefined) } ).to.throwError(); // synonym of throwException
expect( function(){ MyFunction(undefined) } ).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();
expect( function(){ MyFunction(undefined) } ).to.throwException(/matches the exception message/);
expect( function(){ MyFunction('some input') } ).to.not.throwException();
```

**withArgs**: creates anonymous function to call fn with arguments
Expand Down