From 557f89d441ae41c0a3a075afabdbc3263b651789 Mon Sep 17 00:00:00 2001 From: Marcos Nils Date: Thu, 21 Jan 2016 16:56:28 -0300 Subject: [PATCH] Update README.md Add persist option. --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 7293481..7a8863d 100644 --- a/README.md +++ b/README.md @@ -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: