Skip to content

dependabit / test-utils/src / createMockErrorResponse

Function: createMockErrorResponse() ​

ts
function createMockErrorResponse(message?): any;

Defined in: packages/test-utils/src/fixtures.ts:83

Creates a generic mock error response envelope for testing.

Parameters ​

ParameterTypeDefault valueDescription
messagestring'Test error'Error message string.

Returns ​

any

Mock error response with success: false.

Example ​

ts
const error = createMockErrorResponse('Not found');
expect(error.success).toBe(false);

Released under the MIT License.