aboutsummaryrefslogtreecommitdiffstats
path: root/public/mockServiceWorker.js
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-12-15 18:50:26 +0100
committerArmand Philippot <git@armandphilippot.com>2023-12-15 19:30:57 +0100
commitbc9a120b56494d5502de9619b79594653b8fd6e6 (patch)
tree013a7091d9d3f7af8935b57dad1227c4217d75c9 /public/mockServiceWorker.js
parent0f936ec0e7606cb79434d94096b6e113a7ce78eb (diff)
build(deps): bump all dependencies except undici
undici v6 is breaking Jest tests (ReadableStream, structuredClone)
Diffstat (limited to 'public/mockServiceWorker.js')
-rw-r--r--public/mockServiceWorker.js13
1 files changed, 4 insertions, 9 deletions
diff --git a/public/mockServiceWorker.js b/public/mockServiceWorker.js
index 405dc11..9a62419 100644
--- a/public/mockServiceWorker.js
+++ b/public/mockServiceWorker.js
@@ -2,13 +2,13 @@
/* tslint:disable */
/**
- * Mock Service Worker (2.0.9).
+ * Mock Service Worker (2.0.11).
* @see https://github.com/mswjs/msw
* - Please do NOT modify this file.
* - Please do NOT serve this file on production.
*/
-const INTEGRITY_CHECKSUM = '0877fcdc026242810f5bfde0d7178db4';
+const INTEGRITY_CHECKSUM = 'c5f7f8e188b673ea4e677df7ea3c5a39';
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse');
const activeClientIds = new Set();
@@ -121,11 +121,6 @@ async function handleRequest(event, requestId) {
if (client && activeClientIds.has(client.id)) {
(async function () {
const responseClone = response.clone();
- // When performing original requests, response body will
- // always be a ReadableStream, even for 204 responses.
- // But when creating a new Response instance on the client,
- // the body for a 204 response must be null.
- const responseBody = response.status === 204 ? null : responseClone.body;
sendToClient(
client,
@@ -137,11 +132,11 @@ async function handleRequest(event, requestId) {
type: responseClone.type,
status: responseClone.status,
statusText: responseClone.statusText,
- body: responseBody,
+ body: responseClone.body,
headers: Object.fromEntries(responseClone.headers.entries()),
},
},
- [responseBody]
+ [responseClone.body]
);
})();
}