nock 13.5.0 → 13.5.1
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 +6 -0
- package/lib/common.js +1 -4
- package/lib/intercept.js +2 -2
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -66,6 +66,7 @@ For instance, if a module performs HTTP requests to a CouchDB server or makes HT
|
|
|
66
66
|
- [.pendingMocks()](#pendingmocks)
|
|
67
67
|
- [.activeMocks()](#activemocks)
|
|
68
68
|
- [.isActive()](#isactive)
|
|
69
|
+
- [.clone()](#clone)
|
|
69
70
|
- [Restoring](#restoring)
|
|
70
71
|
- [Activating](#activating)
|
|
71
72
|
- [Turning Nock Off (experimental!)](#turning-nock-off-experimental)
|
|
@@ -89,6 +90,8 @@ For instance, if a module performs HTTP requests to a CouchDB server or makes HT
|
|
|
89
90
|
- [Options](#options-1)
|
|
90
91
|
- [Example](#example)
|
|
91
92
|
- [Modes](#modes)
|
|
93
|
+
- [Verifying recorded fixtures](#verifying-recorded-fixtures)
|
|
94
|
+
- [Example](#example-1)
|
|
92
95
|
- [Common issues](#common-issues)
|
|
93
96
|
- [Axios](#axios)
|
|
94
97
|
- [Memory issues with Jest](#memory-issues-with-jest)
|
|
@@ -1693,6 +1696,9 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/all-contri
|
|
|
1693
1696
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Beretta1979"><img src="https://avatars.githubusercontent.com/u/10073962?v=4?s=100" width="100px;" alt="Sébastien Van Bruaene"/><br /><sub><b>Sébastien Van Bruaene</b></sub></a><br /><a href="https://github.com/nock/nock/commits?author=Beretta1979" title="Code">💻</a> <a href="https://github.com/nock/nock/commits?author=Beretta1979" title="Tests">⚠️</a></td>
|
|
1694
1697
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Uzlopak"><img src="https://avatars.githubusercontent.com/u/5059100?v=4?s=100" width="100px;" alt="Aras Abbasi"/><br /><sub><b>Aras Abbasi</b></sub></a><br /><a href="https://github.com/nock/nock/commits?author=Uzlopak" title="Code">💻</a> <a href="https://github.com/nock/nock/commits?author=Uzlopak" title="Tests">⚠️</a> <a href="#maintenance-Uzlopak" title="Maintenance">🚧</a></td>
|
|
1695
1698
|
</tr>
|
|
1699
|
+
<tr>
|
|
1700
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rsaryev"><img src="https://avatars.githubusercontent.com/u/70219513?v=4?s=100" width="100px;" alt="Saryev Rustam"/><br /><sub><b>Saryev Rustam</b></sub></a><br /><a href="https://github.com/nock/nock/commits?author=rsaryev" title="Code">💻</a> <a href="https://github.com/nock/nock/commits?author=rsaryev" title="Tests">⚠️</a></td>
|
|
1701
|
+
</tr>
|
|
1696
1702
|
</tbody>
|
|
1697
1703
|
</table>
|
|
1698
1704
|
|
package/lib/common.js
CHANGED
|
@@ -70,10 +70,7 @@ function overrideRequests(newRequest) {
|
|
|
70
70
|
debug('- overriding request for', proto)
|
|
71
71
|
|
|
72
72
|
const moduleName = proto // 1 to 1 match of protocol and module is fortunate :)
|
|
73
|
-
const module =
|
|
74
|
-
http: require('http'),
|
|
75
|
-
https: require('https'),
|
|
76
|
-
}[moduleName]
|
|
73
|
+
const module = require(proto)
|
|
77
74
|
const overriddenRequest = module.request
|
|
78
75
|
const overriddenGet = module.get
|
|
79
76
|
|
package/lib/intercept.js
CHANGED
|
@@ -370,8 +370,6 @@ function activate() {
|
|
|
370
370
|
throw new Error('Nock already active')
|
|
371
371
|
}
|
|
372
372
|
|
|
373
|
-
overrideClientRequest()
|
|
374
|
-
|
|
375
373
|
// ----- Overriding http.request and https.request:
|
|
376
374
|
|
|
377
375
|
common.overrideRequests(function (proto, overriddenRequest, args) {
|
|
@@ -435,6 +433,8 @@ function activate() {
|
|
|
435
433
|
}
|
|
436
434
|
}
|
|
437
435
|
})
|
|
436
|
+
|
|
437
|
+
overrideClientRequest()
|
|
438
438
|
}
|
|
439
439
|
|
|
440
440
|
module.exports = {
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"testing",
|
|
8
8
|
"isolation"
|
|
9
9
|
],
|
|
10
|
-
"version": "13.5.
|
|
10
|
+
"version": "13.5.1",
|
|
11
11
|
"author": "Pedro Teixeira <pedro.teixeira@gmail.com>",
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"eslint-plugin-promise": "^6.0.0",
|
|
42
42
|
"form-data": "^4.0.0",
|
|
43
43
|
"got": "^11.3.0",
|
|
44
|
+
"jest": "^29.7.0",
|
|
44
45
|
"mocha": "^9.1.3",
|
|
45
46
|
"npm-run-all": "^4.1.5",
|
|
46
47
|
"nyc": "^15.0.0",
|
|
@@ -60,7 +61,8 @@
|
|
|
60
61
|
"lint:js:fix": "eslint --cache --cache-location './.cache/eslint' --fix '**/*.js'",
|
|
61
62
|
"lint:ts": "dtslint --expectOnly types",
|
|
62
63
|
"test": "nyc --reporter=lcov --reporter=text mocha --recursive tests",
|
|
63
|
-
"test:coverage": "open coverage/lcov-report/index.html"
|
|
64
|
+
"test:coverage": "open coverage/lcov-report/index.html",
|
|
65
|
+
"test:jest": "jest tests_jest --detectLeaks"
|
|
64
66
|
},
|
|
65
67
|
"license": "MIT",
|
|
66
68
|
"files": [
|