nock 13.1.2 → 13.1.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/lib/interceptor.js +7 -3
- package/package.json +1 -1
package/lib/interceptor.js
CHANGED
|
@@ -442,13 +442,17 @@ module.exports = class Interceptor {
|
|
|
442
442
|
markConsumed() {
|
|
443
443
|
this.interceptionCounter++
|
|
444
444
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
445
|
+
if (
|
|
446
|
+
(this.scope.shouldPersist() || this.counter > 0) &&
|
|
447
|
+
this.interceptionCounter > 1 &&
|
|
448
|
+
this.filePath
|
|
449
|
+
) {
|
|
448
450
|
this.body = fs.createReadStream(this.filePath)
|
|
449
451
|
this.body.pause()
|
|
450
452
|
}
|
|
451
453
|
|
|
454
|
+
remove(this)
|
|
455
|
+
|
|
452
456
|
if (!this.scope.shouldPersist() && this.counter < 1) {
|
|
453
457
|
this.scope.remove(this._key, this)
|
|
454
458
|
}
|