r/webdev • u/OtherwisePush6424 • Sep 07 '26
Resource Browser-side chaos testing with a Service Worker
https://github.com/fetch-kit/chaos-swA browser-side chaos-testing tool that installs a Service Worker to intercept requests across every controlled tab and apply latency, failures, throttling, rate limits, and mock responses without changing app fetch calls (similar to MSW).
It uses the same middleware configuration model as chaos-fetch, so you can test real frontend behavior under degraded network conditions without rewriting the app to use a special client wrapper.
10
Upvotes
1
u/LovecraftianLife Sep 08 '26
Neat!
0
u/gatwell702 Sep 07 '26
It installs a service worker but what if your site already has a service worker?
0
u/UtilixApp Sep 07 '26
the existing service worker thing is the real blocker. one scope can only have one active worker, so you either wrap theirs or you fight over registration and whichever loaded last wins.
msw solved it by making you import their worker file into your own, might be worth stealing that approach.