From a65dd08f45adf1e8acfced09cf7c1227c21dd0ab Mon Sep 17 00:00:00 2001 From: Nikola Mitrovic Date: Sat, 22 Jun 2024 10:18:53 +0200 Subject: [PATCH] Chapter06 MSW bypass real requests. --- Chapter06/custom-state-management/src/main.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Chapter06/custom-state-management/src/main.ts b/Chapter06/custom-state-management/src/main.ts index ab5b448..65d2468 100644 --- a/Chapter06/custom-state-management/src/main.ts +++ b/Chapter06/custom-state-management/src/main.ts @@ -12,7 +12,9 @@ async function enableMocking() { // `worker.start()` returns a Promise that resolves // once the Service Worker is up and ready to intercept requests. - return worker.start() + return worker.start({ + onUnhandledRequest: "bypass", // Optional: Let real requests pass through if not mocked + }) } enableMocking().then(() => {