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.
@@ -442,13 +442,17 @@ module.exports = class Interceptor {
442
442
  markConsumed() {
443
443
  this.interceptionCounter++
444
444
 
445
- remove(this)
446
-
447
- if ((this.scope.shouldPersist() || this.counter > 0) && this.filePath) {
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
  }
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "testing",
8
8
  "isolation"
9
9
  ],
10
- "version": "13.1.2",
10
+ "version": "13.1.3",
11
11
  "author": "Pedro Teixeira <pedro.teixeira@gmail.com>",
12
12
  "repository": {
13
13
  "type": "git",