Skip to content

testingDefaults โ€‹

Global default HTTP statuses for testing helpers: successStatus and errorStatus start at 200 and 500. Reassign them (e.g. in beforeAll) if most mocks in a suite should use something else.

ts
import { testingDefaults } from "mobx-tanstack-query-api/testing";

testingDefaults.errorStatus = 400;

Used by MockHttpResponse, mswEndpointResponse, and mswEndpointErrorResponse. For a single mock, override with status / setData / setError on MockHttpResponse, or init.status on the MSW helpers.

See also โ€‹

Released under the MIT License.