nock 13.3.2 → 13.3.3
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/README.md +1 -1
- package/lib/intercept.js +1 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1005,7 +1005,7 @@ const scope = nock('http://example.com')
|
|
|
1005
1005
|
.reply(200, 'Persisting all the way')
|
|
1006
1006
|
```
|
|
1007
1007
|
|
|
1008
|
-
Note that while a persisted scope will always intercept the requests, it is considered "done" after the first interception
|
|
1008
|
+
Note that while a persisted scope will always intercept the requests, it is considered "done" after the first interception.
|
|
1009
1009
|
|
|
1010
1010
|
If you want to stop persisting an individual persisted mock you can call `persist(false)`:
|
|
1011
1011
|
|
package/lib/intercept.js
CHANGED
|
@@ -110,7 +110,7 @@ function addInterceptor(key, interceptor, scope, scopeOptions, host) {
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
function remove(interceptor) {
|
|
113
|
-
if (--interceptor.counter > 0) {
|
|
113
|
+
if (interceptor.__nock_scope.shouldPersist() || --interceptor.counter > 0) {
|
|
114
114
|
return
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -122,12 +122,6 @@ function remove(interceptor) {
|
|
|
122
122
|
// matching instance. I'm also not sure why we couldn't delete _all_
|
|
123
123
|
// matching instances.
|
|
124
124
|
interceptors.some(function (thisInterceptor, i) {
|
|
125
|
-
if (interceptor.__nock_scope.shouldPersist()) {
|
|
126
|
-
return thisInterceptor === interceptor
|
|
127
|
-
? interceptors.push(interceptors.splice(i, 1)[0])
|
|
128
|
-
: false
|
|
129
|
-
}
|
|
130
|
-
|
|
131
125
|
return thisInterceptor === interceptor ? interceptors.splice(i, 1) : false
|
|
132
126
|
})
|
|
133
127
|
}
|