From a0f8021ccf16565e772b81b1c70bebdba6d1df58 Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Sat, 16 Mar 2024 13:02:28 +0100 Subject: [PATCH] fix: make worker integrity mismatch a warning (#2090) --- src/browser/setupWorker/start/createStartHandler.ts | 2 +- test/browser/msw-api/integrity-check.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/browser/setupWorker/start/createStartHandler.ts b/src/browser/setupWorker/start/createStartHandler.ts index 9634ced38..04bbe5154 100644 --- a/src/browser/setupWorker/start/createStartHandler.ts +++ b/src/browser/setupWorker/start/createStartHandler.ts @@ -80,7 +80,7 @@ Please consider using a custom "serviceWorker.url" option to point to the actual ) if (integrityCheckResult.error) { - devUtils.error(`\ + devUtils.warn(`\ Detected outdated Service Worker: ${integrityCheckResult.error.message} The mocking is still enabled, but it's highly recommended that you update your Service Worker by running: diff --git a/test/browser/msw-api/integrity-check.test.ts b/test/browser/msw-api/integrity-check.test.ts index dba8420db..8d4d324f0 100644 --- a/test/browser/msw-api/integrity-check.test.ts +++ b/test/browser/msw-api/integrity-check.test.ts @@ -65,7 +65,7 @@ test('errors when activating the worker with an outdated integrity', async ({ await waitFor(() => { // Produces a meaningful error in the browser's console. - expect(consoleSpy.get('error')).toEqual( + expect(consoleSpy.get('warning')).toEqual( expect.arrayContaining([ expect.stringContaining('[MSW] Detected outdated Service Worker'), ]),