nock 14.0.0-beta.2 → 14.0.0-beta.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/README.md CHANGED
@@ -9,8 +9,13 @@
9
9
  [npmjs]: https://www.npmjs.com/package/nock
10
10
  [build]: https://travis-ci.org/nock/nock
11
11
 
12
- > **Warning**
13
- > nock is currently not compatible with Node's experimental native `fetch` implementation. See [#2397](https://github.com/nock/nock/issues/2397)
12
+ > **Notice**
13
+ >
14
+ > We have introduced experimental support for fetch. Please share your feedback with us. You can install it by:
15
+ >
16
+ > ```
17
+ > npm install --save-dev nock@beta
18
+ > ```
14
19
 
15
20
  HTTP server mocking and expectations library for Node.js
16
21
 
@@ -1698,6 +1703,7 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/all-contri
1698
1703
  </tr>
1699
1704
  <tr>
1700
1705
  <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>
1706
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/mikicho"><img src="https://avatars.githubusercontent.com/u/11459632?v=4?s=100" width="100px;" alt="Michael Solomon"/><br /><sub><b>Michael Solomon</b></sub></a><br /><a href="#maintenance-mikicho" title="Maintenance">🚧</a> <a href="https://github.com/nock/nock/commits?author=mikicho" title="Code">💻</a> <a href="https://github.com/nock/nock/commits?author=mikicho" title="Documentation">📖</a></td>
1701
1707
  </tr>
1702
1708
  </tbody>
1703
1709
  </table>
@@ -1,6 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  const { headersArrayToObject } = require('./common')
4
+ const { STATUS_CODES } = require('http')
4
5
 
5
6
  /**
6
7
  * Creates a Fetch API `Response` instance from the given
@@ -37,7 +38,7 @@ function createResponse(message) {
37
38
 
38
39
  return new Response(responseBodyOrNull, {
39
40
  status: message.statusCode,
40
- statusText: message.statusMessage,
41
+ statusText: STATUS_CODES[message.statusCode],
41
42
  headers: headersArrayToObject(message.rawHeaders),
42
43
  })
43
44
  }
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "testing",
8
8
  "isolation"
9
9
  ],
10
- "version": "14.0.0-beta.2",
10
+ "version": "14.0.0-beta.3",
11
11
  "author": "Pedro Teixeira <pedro.teixeira@gmail.com>",
12
12
  "repository": {
13
13
  "type": "git",