MCPcopy Index your code
hub / github.com/coder/coder / mockApiError

Function mockApiError

site/src/testHelpers/entities.ts:2641–2655  ·  view source on GitHub ↗
({
	message = "Something went wrong.",
	detail,
	validations,
}: MockAPIInput)

Source from the content-addressed store, hash-verified

2639};
2640
2641export const mockApiError = ({
2642 message = "Something went wrong.",
2643 detail,
2644 validations,
2645}: MockAPIInput): MockAPIOutput => ({
2646 // This is how axios can check if it is an axios error when calling isAxiosError
2647 isAxiosError: true,
2648 response: {
2649 data: {
2650 message,
2651 detail,
2652 validations,
2653 },
2654 },
2655});
2656
2657export const MockEntitlements: TypesGen.Entitlements = {
2658 errors: [],

Calls

no outgoing calls

Tested by

no test coverage detected