Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ikhilko committed Oct 14, 2015
1 parent 4315188 commit 643f998
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ request
;
```

`mock.put()` method works in a similar way.
`mock.put()`, `mock.patch()` methods works in a similar way.

### Teardown

Expand Down Expand Up @@ -124,6 +124,24 @@ define('My API module', function(){
})
```

Or you can remove only one specified route (by method and url)

```js
// to register route
mock.get('/me', function(){done()})

...

// to remove registered handler
mock.clearRoute('get', '/me');

```

### Rollback library effect

In some cases it will be useful to remove patches from superagent lib after using mocks.
In this cases you can use ```mock.unmock()``` method, that will rollback all patches that ```mock(superagent)``` call make.

## License

MIT © [Shuvalov Anton](http://shuvalov.info)
Expand Down

0 comments on commit 643f998

Please sign in to comment.