Skip to content

Commit

Permalink
Chapter06 MSW bypass real requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikola Mitrovic authored and Nikola Mitrovic committed Jun 22, 2024
1 parent 923adac commit a65dd08
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Chapter06/custom-state-management/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down

0 comments on commit a65dd08

Please sign in to comment.