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 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, and they are pushed to the bottom of the stack after consumption.
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
  }
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "testing",
8
8
  "isolation"
9
9
  ],
10
- "version": "13.3.2",
10
+ "version": "13.3.3",
11
11
  "author": "Pedro Teixeira <pedro.teixeira@gmail.com>",
12
12
  "repository": {
13
13
  "type": "git",