nock 14.0.9 → 14.0.11
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 -5
- package/lib/intercept.js +1 -3
- package/lib/recorder.js +1 -3
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -461,13 +461,14 @@ nock('http://www.google.com')
|
|
|
461
461
|
.replyWithError('something awful happened')
|
|
462
462
|
```
|
|
463
463
|
|
|
464
|
-
|
|
464
|
+
Error objects are allowed too:
|
|
465
465
|
|
|
466
466
|
```js
|
|
467
|
-
nock('http://www.google.com')
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
})
|
|
467
|
+
nock('http://www.google.com')
|
|
468
|
+
.get('/cat-poems')
|
|
469
|
+
.replyWithError(
|
|
470
|
+
Object.assign(new Error('Connection refused'), { code: 'ECONNREFUSED' }),
|
|
471
|
+
)
|
|
471
472
|
```
|
|
472
473
|
|
|
473
474
|
> Note: This will emit an `error` event on the `request` object, not the reply.
|
package/lib/intercept.js
CHANGED
|
@@ -11,9 +11,7 @@ const http = require('http')
|
|
|
11
11
|
const { intercept: debug } = require('./debug')
|
|
12
12
|
const globalEmitter = require('./global_emitter')
|
|
13
13
|
const { BatchInterceptor, getRawRequest } = require('@mswjs/interceptors')
|
|
14
|
-
const
|
|
15
|
-
default: nodeInterceptors,
|
|
16
|
-
} = require('@mswjs/interceptors/presets/node')
|
|
14
|
+
const nodeInterceptors = require('@mswjs/interceptors/presets/node')
|
|
17
15
|
const { createResponse } = require('./create_response')
|
|
18
16
|
const { once } = require('events')
|
|
19
17
|
const { arrayBuffer } = require('stream/consumers')
|
package/lib/recorder.js
CHANGED
|
@@ -7,9 +7,7 @@ const { inspect } = require('util')
|
|
|
7
7
|
const common = require('./common')
|
|
8
8
|
const { restoreOverriddenClientRequest } = require('./intercept')
|
|
9
9
|
const { gzipSync, brotliCompressSync, deflateSync } = require('zlib')
|
|
10
|
-
const
|
|
11
|
-
default: nodeInterceptors,
|
|
12
|
-
} = require('@mswjs/interceptors/presets/node')
|
|
10
|
+
const nodeInterceptors = require('@mswjs/interceptors/presets/node')
|
|
13
11
|
const SEPARATOR = '\n<<<<<<-- cut here -->>>>>>\n'
|
|
14
12
|
let recordingInProgress = false
|
|
15
13
|
let outputs = []
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"testing",
|
|
8
8
|
"isolation"
|
|
9
9
|
],
|
|
10
|
-
"version": "14.0.
|
|
10
|
+
"version": "14.0.11",
|
|
11
11
|
"author": "Pedro Teixeira <pedro.teixeira@gmail.com>",
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"main": "./index.js",
|
|
23
23
|
"types": "types",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@mswjs/interceptors": "^0.
|
|
25
|
+
"@mswjs/interceptors": "^0.41.0",
|
|
26
26
|
"json-stringify-safe": "^5.0.1",
|
|
27
27
|
"propagate": "^2.0.0"
|
|
28
28
|
},
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"form-data": "^4.0.0",
|
|
43
43
|
"got": "^11.3.0",
|
|
44
44
|
"jest": "^29.7.0",
|
|
45
|
-
"mocha": "^
|
|
45
|
+
"mocha": "^11.7.2",
|
|
46
46
|
"npm-run-all": "^4.1.5",
|
|
47
47
|
"nyc": "^15.0.0",
|
|
48
|
-
"prettier": "3.2
|
|
48
|
+
"prettier": "3.6.2",
|
|
49
49
|
"proxyquire": "^2.1.0",
|
|
50
50
|
"rimraf": "^3.0.0",
|
|
51
|
-
"semantic-release": "^
|
|
51
|
+
"semantic-release": "^25.0.3",
|
|
52
52
|
"sinon": "^17.0.1",
|
|
53
53
|
"sinon-chai": "^3.7.0",
|
|
54
54
|
"typescript": "^5.0.4"
|