mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-26 22:57:32 +00:00
32837afe2e
msw 3 renames onUnhandledRequest to onUnhandledFrame and reports every network frame there; the setup judges the HTTP frames as before (another origin is an error, the page's own a warning). It also resolves a relative handler, and its fetch interceptor a relative URL, against location.href at the time of the request, while jsdom's XHR sends to the document's own address. Tests that replaced window.location with a stand-in on http://localhost while the page runs on http://localhost:3000 sent their requests past every handler. tests/helpers/location.ts builds such stand-ins on the page's own origin (locationAt, pageUrl), and every one of them now uses it. msw no longer escapes fake timers, and responses are timed differently, which surfaced tests that ended with work still running: a held request answering in the next test, a lookup still out when the assertions ran, a reload switched by counting reads. Each of those now waits for, or releases, what it started, and answers by what happened rather than by a count. The day panel suites share their setup through tests/helpers/dayDetailPanel.ts instead of a copy each, which keeps the larger one under its size limit.