Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
stormslowly committed Mar 25, 2016
1 parent 4e9f08e commit cd7cd1a
Show file tree
Hide file tree
Showing 2 changed files with 23,761 additions and 23,614 deletions.
14 changes: 14 additions & 0 deletions README.md
Expand Up @@ -230,6 +230,20 @@ nock('http://example.com')
.reply(200, {results: [{id: 'pgte'}]});
```

Nock supports passing a function to query. The function determines if the actual query matches or not.

```js
nock('http://example.com')
.get('/users')
.query(function(actualQueryObject){
// do some compare with the actual Query Object
// return true for matched
// return false for not matched
return true;
})
.reply(200, {results: [{id: 'pgte'}]});
```

To mock the entire url regardless of the passed query string:

```js
Expand Down

0 comments on commit cd7cd1a

Please sign in to comment.