nock 2.9.1 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.travis.yml +4 -1
- package/README.md +2 -2
- package/coverage/coverage.json +1 -1
- package/coverage/lcov-report/index.html +14 -14
- package/coverage/lcov-report/nock/index.html +1 -1
- package/coverage/lcov-report/nock/index.js.html +1 -1
- package/coverage/lcov-report/nock/lib/back.js.html +1 -1
- package/coverage/lcov-report/nock/lib/common.js.html +65 -65
- package/coverage/lcov-report/nock/lib/delayed_body.js.html +1 -1
- package/coverage/lcov-report/nock/lib/index.html +21 -21
- package/coverage/lcov-report/nock/lib/intercept.js.html +71 -71
- package/coverage/lcov-report/nock/lib/match_body.js.html +3 -3
- package/coverage/lcov-report/nock/lib/mixin.js.html +1 -1
- package/coverage/lcov-report/nock/lib/recorder.js.html +178 -112
- package/coverage/lcov-report/nock/lib/request_overrider.js.html +127 -127
- package/coverage/lcov-report/nock/lib/scope.js.html +328 -76
- package/coverage/lcov-report/nock/lib/socket.js.html +12 -12
- package/coverage/lcov.info +1225 -1142
- package/lib/recorder.js +10 -2
- package/lib/request_overrider.js +11 -1
- package/lib/scope.js +25 -10
- package/lib/socket.js +7 -1
- package/package.json +9 -4
- package/tests/test_back.js +3 -3
- package/tests/test_basic_auth.js +50 -13
- package/tests/test_data.js +1 -2
- package/tests/test_dynamic_mock.js +0 -2
- package/tests/test_intercept.js +19 -1
package/.travis.yml
CHANGED
package/README.md
CHANGED
|
@@ -152,7 +152,7 @@ Nock understands query strings. Instead of placing the entire URL, you can speci
|
|
|
152
152
|
nock('http://example.com')
|
|
153
153
|
.get('/users')
|
|
154
154
|
.query({name: 'pedro', surname: 'teixeira'})
|
|
155
|
-
.reply({results: [{id: 'pgte'}]});
|
|
155
|
+
.reply(200, {results: [{id: 'pgte'}]});
|
|
156
156
|
```
|
|
157
157
|
|
|
158
158
|
To mock the entire url regardless of the passed query string:
|
|
@@ -161,7 +161,7 @@ To mock the entire url regardless of the passed query string:
|
|
|
161
161
|
nock('http://example.com')
|
|
162
162
|
.get('/users')
|
|
163
163
|
.query(true)
|
|
164
|
-
.reply({results: [{id: 'pgte'}]});
|
|
164
|
+
.reply(200, {results: [{id: 'pgte'}]});
|
|
165
165
|
```
|
|
166
166
|
|
|
167
167
|
## Specifying replies
|