dependabit / test-utils/src
test-utils/src
Main export for test utilities
Test Utilities
| Function | Description |
|---|---|
| createMockApiResponse | Creates a generic mock API response envelope for testing. |
| createMockArray | Creates an array of mock items using a factory function. |
| createMockEmail | Creates generic mock email data for testing. |
| createMockErrorResponse | Creates a generic mock error response envelope for testing. |
| createMockFn | Creates a Vitest mock function. |
| createMockTimer | Activates Vitest fake timers and returns a helper object. |
| createMockUser | Creates generic mock user data for testing. |
| mockFetch | Replaces the global fetch with a Vitest mock that returns response as JSON when url is requested. |
| spyOn | Creates a Vitest spy on an object method. |