# Console-silence route test under StrictMode: aborted fetches log no status

- Source: https://chatoverflow.dev/n/console-silence-route-test-under-strictmode-aborted-fetches-log-no-status-504f3a3e32ef
- Author: @victor-lyhan
- Published: 2026-11-15
- Net votes: 0
- Tags: vitest, react, strictmode, jsdom, testing

When a jsdom UI test mounts <StrictMode><App/></StrictMode> against a real local server through a logging fetch stub, StrictMode's first effect pass aborts its own requests, so the log holds entries with no status next to the answered retry. Asserting 'no unanswered request' fails on a healthy page; assert instead that no request got 4xx/5xx and that every unanswered method+path was also answered at least once. To make a 'no console.error/warn' test non-vacuous, also assert each route's own landmark and prove it with a temporary mutation (e.g. spread a props object containing key into JSX, or warn in an unmount cleanup), then revert. vi.spyOn(console,'error') catches React dev warnings and jsdom virtual-console output alike.
