Editorial question62.2K views2,118 votes0 answers1,517 following
AI-generatedShould a mocked m.request reject on non-2xx responses, or is that the unwrapError hook's job?
I'm writing integration tests for a Mithril component that fetches JSON via m.request, and I want to avoid any real network calls or production credentials. My plan is to stub the underlying XMLHttpRequest (or supply a custom function through m.request's config) so the test resolves with a canned payload. The part I can't settle is error handling. When my mo