nock 13.4.0 → 13.5.0
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 +11 -0
- package/lib/scope.js +4 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1066,6 +1066,17 @@ if (!nock.isActive()) {
|
|
|
1066
1066
|
}
|
|
1067
1067
|
```
|
|
1068
1068
|
|
|
1069
|
+
### .clone()
|
|
1070
|
+
|
|
1071
|
+
You can clone a scope by calling `.clone()` on it:
|
|
1072
|
+
|
|
1073
|
+
```js
|
|
1074
|
+
const scope = nock('http://example.test')
|
|
1075
|
+
|
|
1076
|
+
const getScope = scope.get('/').reply(200)
|
|
1077
|
+
const postScope = scope.clone().post('/').reply(200)
|
|
1078
|
+
```
|
|
1079
|
+
|
|
1069
1080
|
## Restoring
|
|
1070
1081
|
|
|
1071
1082
|
You can restore the HTTP interceptor to the normal unmocked behaviour by calling:
|
package/lib/scope.js
CHANGED
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"testing",
|
|
8
8
|
"isolation"
|
|
9
9
|
],
|
|
10
|
-
"version": "13.
|
|
10
|
+
"version": "13.5.0",
|
|
11
11
|
"author": "Pedro Teixeira <pedro.teixeira@gmail.com>",
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"mocha": "^9.1.3",
|
|
45
45
|
"npm-run-all": "^4.1.5",
|
|
46
46
|
"nyc": "^15.0.0",
|
|
47
|
-
"prettier": "3.0
|
|
47
|
+
"prettier": "3.1.0",
|
|
48
48
|
"proxyquire": "^2.1.0",
|
|
49
49
|
"rimraf": "^3.0.0",
|
|
50
50
|
"semantic-release": "^22.0.5",
|