msw 2.4.13 → 2.5.1
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/lib/browser/index.js +7 -3
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/index.mjs +7 -3
- package/lib/browser/index.mjs.map +1 -1
- package/lib/iife/index.js +7 -3
- package/lib/iife/index.js.map +1 -1
- package/lib/mockServiceWorker.js +12 -3
- package/package.json +2 -2
- package/src/browser/setupWorker/glossary.ts +6 -1
- package/src/browser/setupWorker/start/utils/enableMocking.ts +2 -1
- package/src/browser/setupWorker/start/utils/printStartMessage.ts +7 -0
- package/src/mockServiceWorker.js +10 -1
package/lib/iife/index.js
CHANGED
|
@@ -28639,13 +28639,16 @@ Learn more about creating the Service Worker script: https://mswjs.io/docs/cli/i
|
|
|
28639
28639
|
if (args.workerScope) {
|
|
28640
28640
|
console.log("Worker scope:", args.workerScope);
|
|
28641
28641
|
}
|
|
28642
|
+
if (args.client) {
|
|
28643
|
+
console.log("Client ID: %s (%s)", args.client.id, args.client.frameType);
|
|
28644
|
+
}
|
|
28642
28645
|
console.groupEnd();
|
|
28643
28646
|
}
|
|
28644
28647
|
|
|
28645
28648
|
// src/browser/setupWorker/start/utils/enableMocking.ts
|
|
28646
28649
|
async function enableMocking(context, options) {
|
|
28647
28650
|
context.workerChannel.send("MOCK_ACTIVATE");
|
|
28648
|
-
await context.events.once("MOCKING_ENABLED");
|
|
28651
|
+
const { payload } = await context.events.once("MOCKING_ENABLED");
|
|
28649
28652
|
if (context.isMockingEnabled) {
|
|
28650
28653
|
devUtils.warn(
|
|
28651
28654
|
`Found a redundant "worker.start()" call. Note that starting the worker while mocking is already enabled will have no effect. Consider removing this "worker.start()" call.`
|
|
@@ -28656,7 +28659,8 @@ Learn more about creating the Service Worker script: https://mswjs.io/docs/cli/i
|
|
|
28656
28659
|
printStartMessage({
|
|
28657
28660
|
quiet: options.quiet,
|
|
28658
28661
|
workerScope: context.registration?.scope,
|
|
28659
|
-
workerUrl: context.worker?.scriptURL
|
|
28662
|
+
workerUrl: context.worker?.scriptURL,
|
|
28663
|
+
client: payload.client
|
|
28660
28664
|
});
|
|
28661
28665
|
}
|
|
28662
28666
|
|
|
@@ -28783,7 +28787,7 @@ This exception has been gracefully handled as a 500 response, however, it's stro
|
|
|
28783
28787
|
async function checkWorkerIntegrity(context) {
|
|
28784
28788
|
context.workerChannel.send("INTEGRITY_CHECK_REQUEST");
|
|
28785
28789
|
const { payload } = await context.events.once("INTEGRITY_CHECK_RESPONSE");
|
|
28786
|
-
if (payload.checksum !== "
|
|
28790
|
+
if (payload.checksum !== "07a8241b182f8a246a7cd39894799a9e") {
|
|
28787
28791
|
devUtils.warn(
|
|
28788
28792
|
`The currently registered Service Worker has been generated by a different version of MSW (${payload.packageVersion}) and may not be fully compatible with the installed version.
|
|
28789
28793
|
|