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: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ Or if using mocha:
```js
handler.wait(200, done);
```
### Persist handlers between tests

By default shock will unregister the mock handler once they have been invoked. If for some reason you need to keep them for more than one use, you can specify it as follows:

```js
mock.get("/foo").persist().reply(200);
```


### Custom middleware
Custom middlewares can be injected into the Express stack in order to perform arbitrary manipulations on mock requests, for instance:
Expand Down