msw 2.2.3 → 2.2.4
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/cli/init.js +1 -1
- package/lib/core/{GraphQLHandler-AenIUdwE.d.mts → GraphQLHandler-BumTfgY4.d.mts} +1 -1
- package/lib/core/{GraphQLHandler-jOzqbxSK.d.ts → GraphQLHandler-DqVT0Gbq.d.ts} +1 -1
- package/lib/core/HttpResponse.d.mts +1 -1
- package/lib/core/HttpResponse.d.ts +1 -1
- package/lib/core/SetupApi.d.mts +1 -1
- package/lib/core/SetupApi.d.ts +1 -1
- package/lib/core/getResponse.d.mts +1 -1
- package/lib/core/getResponse.d.ts +1 -1
- package/lib/core/graphql.d.mts +2 -2
- package/lib/core/graphql.d.ts +2 -2
- package/lib/core/handlers/GraphQLHandler.d.mts +2 -2
- package/lib/core/handlers/GraphQLHandler.d.ts +2 -2
- package/lib/core/handlers/HttpHandler.d.mts +1 -1
- package/lib/core/handlers/HttpHandler.d.ts +1 -1
- package/lib/core/handlers/RequestHandler.d.mts +1 -1
- package/lib/core/handlers/RequestHandler.d.ts +1 -1
- package/lib/core/http.d.mts +1 -1
- package/lib/core/http.d.ts +1 -1
- package/lib/core/index.d.mts +2 -2
- package/lib/core/index.d.ts +2 -2
- package/lib/core/passthrough.d.mts +1 -1
- package/lib/core/passthrough.d.ts +1 -1
- package/lib/core/utils/HttpResponse/decorators.d.mts +1 -1
- package/lib/core/utils/HttpResponse/decorators.d.ts +1 -1
- package/lib/core/utils/HttpResponse/decorators.js +4 -1
- package/lib/core/utils/HttpResponse/decorators.js.map +1 -1
- package/lib/core/utils/HttpResponse/decorators.mjs +4 -1
- package/lib/core/utils/HttpResponse/decorators.mjs.map +1 -1
- package/lib/core/utils/executeHandlers.d.mts +1 -1
- package/lib/core/utils/executeHandlers.d.ts +1 -1
- package/lib/core/utils/handleRequest.d.mts +1 -1
- package/lib/core/utils/handleRequest.d.ts +1 -1
- package/lib/core/utils/internal/parseGraphQLRequest.d.mts +2 -2
- package/lib/core/utils/internal/parseGraphQLRequest.d.ts +2 -2
- package/lib/core/utils/internal/parseMultipartData.d.mts +1 -1
- package/lib/core/utils/internal/parseMultipartData.d.ts +1 -1
- package/lib/core/utils/internal/requestHandlerUtils.d.mts +1 -1
- package/lib/core/utils/internal/requestHandlerUtils.d.ts +1 -1
- package/lib/iife/index.js +3 -1
- package/lib/iife/index.js.map +1 -1
- package/lib/mockServiceWorker.js +1 -1
- package/package.json +5 -5
- package/src/core/utils/HttpResponse/decorators.ts +8 -4
- /package/lib/core/{HttpResponse-wcp03c7-.d.mts → HttpResponse-C94XLD-W.d.mts} +0 -0
- /package/lib/core/{HttpResponse-_514VQ9z.d.ts → HttpResponse-jHZ0p2dL.d.ts} +0 -0
package/lib/mockServiceWorker.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "msw",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.4",
|
|
4
4
|
"description": "Seamless REST/GraphQL API mocking library for browser and Node.js.",
|
|
5
5
|
"main": "./lib/core/index.js",
|
|
6
6
|
"module": "./lib/core/index.mjs",
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"@commitlint/cli": "^18.4.4",
|
|
127
127
|
"@commitlint/config-conventional": "^18.4.4",
|
|
128
128
|
"@open-draft/test-server": "^0.4.2",
|
|
129
|
-
"@ossjs/release": "^0.8.
|
|
129
|
+
"@ossjs/release": "^0.8.1",
|
|
130
130
|
"@playwright/test": "^1.40.1",
|
|
131
131
|
"@swc/core": "^1.3.102",
|
|
132
132
|
"@types/express": "^4.17.21",
|
|
@@ -134,8 +134,8 @@
|
|
|
134
134
|
"@types/glob": "^8.1.0",
|
|
135
135
|
"@types/json-bigint": "^1.0.4",
|
|
136
136
|
"@types/node": "18.x",
|
|
137
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
138
|
-
"@typescript-eslint/parser": "^
|
|
137
|
+
"@typescript-eslint/eslint-plugin": "^7.2.0",
|
|
138
|
+
"@typescript-eslint/parser": "^7.2.0",
|
|
139
139
|
"@web/dev-server": "^0.1.38",
|
|
140
140
|
"axios": "^1.6.5",
|
|
141
141
|
"babel-minify": "^0.5.1",
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
"cz-conventional-changelog": "3.3.0",
|
|
146
146
|
"esbuild": "^0.19.11",
|
|
147
147
|
"esbuild-loader": "^4.0.2",
|
|
148
|
-
"eslint": "^8.
|
|
148
|
+
"eslint": "^8.57.0",
|
|
149
149
|
"eslint-config-prettier": "^9.1.0",
|
|
150
150
|
"eslint-plugin-prettier": "^5.1.3",
|
|
151
151
|
"express": "^4.18.2",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import statuses from '@bundled-es-modules/statuses'
|
|
2
2
|
import type { HttpResponseInit } from '../../HttpResponse'
|
|
3
|
+
import { Headers as HeadersPolyfill } from 'headers-polyfill'
|
|
3
4
|
|
|
4
5
|
const { message } = statuses
|
|
5
6
|
|
|
@@ -40,10 +41,13 @@ export function decorateResponse(
|
|
|
40
41
|
// Cookie forwarding is only relevant in the browser.
|
|
41
42
|
if (typeof document !== 'undefined') {
|
|
42
43
|
// Write the mocked response cookies to the document.
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
//
|
|
46
|
-
|
|
44
|
+
// Use `headers-polyfill` to get the Set-Cookie header value correctly.
|
|
45
|
+
// This is an alternative until TypeScript 5.2
|
|
46
|
+
// and Node.js v20 become the minimum supported version
|
|
47
|
+
// and getSetCookie in Headers can be used directly.
|
|
48
|
+
const responseCookies = HeadersPolyfill.prototype.getSetCookie.call(
|
|
49
|
+
init.headers,
|
|
50
|
+
)
|
|
47
51
|
|
|
48
52
|
for (const cookieString of responseCookies) {
|
|
49
53
|
// No need to parse the cookie headers because it's defined
|
|
File without changes
|
|
File without changes
|