From c59095af32cac39edab1abab7e8acce24ae555ef Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Tue, 20 Feb 2018 00:10:17 +0800 Subject: [PATCH] nock: update layout --- nock.md | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/nock.md b/nock.md index a488b5630..1eafe7a4c 100644 --- a/nock.md +++ b/nock.md @@ -1,22 +1,28 @@ --- title: Nock category: JavaScript libraries +layout: 2017/sheet --- ### Nock - scope = nock('http://foo.com') - scope = nock('http://foo.com', { allowUnmocked: true }) - - nock('http://foo.com') - .get('/user') - .reply(200, { id: 1234 }) +```js +scope = nock('http://foo.com') +scope = nock('http://foo.com', { allowUnmocked: true }) +``` +```js +nock('http://foo.com') + .get('/user') + .reply(200, { id: 1234 }) +``` ### Filtering - nock('http://foo.com') - .filteringPath(/[&\?]token=[^&]*/g, '') - .get('/user') +```js +nock('http://foo.com') + .filteringPath(/[&\?]token=[^&]*/g, '') + .get('/user') - # catches "/user?token=..." as well +// catches "/user?token=..." as well +```