Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 401 Bytes

nock.md

File metadata and controls

28 lines (22 loc) · 401 Bytes
title category layout
Nock
JavaScript libraries
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 })

Filtering

nock('http://foo.com')
  .filteringPath(/[&\?]token=[^&]*/g, '')
  .get('/user')

// catches "/user?token=..." as well