/** * Response assertion helpers for API testing * * Provides utilities for asserting HTTP response status and body. * * @example * ```typescript * const response = await app.request('/api/presets'); * * // Assert status and get typed body * const body = await assertJsonResponse<{ presets: Preset[] }>(response, 200); * expect(body.presets).toHaveLength(1); * * // Assert error response * const error = await assertErrorResponse(response, 400); * expect(error.error).toBe('Validation failed'); * ``` */ /** * Assert response has expected status and return JSON body * * @param response - The Response object * @param expectedStatus - Expected HTTP status code * @returns The parsed JSON body * @throws If status doesn't match */ export declare function assertJsonResponse(response: Response, expectedStatus: number): Promise; /** * Error response shape */ export interface ErrorResponse { error: string; code?: string; details?: Record; } /** * Assert response is an error with expected status * * @param response - The Response object * @param expectedStatus - Expected HTTP status code * @returns The parsed error body * @throws If status doesn't match */ export declare function assertErrorResponse(response: Response, expectedStatus: number): Promise; /** * Assert response is OK (2xx status) * * @param response - The Response object * @returns The parsed JSON body * @throws If status is not 2xx */ export declare function assertOkResponse(response: Response): Promise; /** * Assert response is a redirect * * @param response - The Response object * @param expectedLocation - Optional expected Location header value * @returns The Location header value * @throws If not a redirect or location doesn't match */ export declare function assertRedirectResponse(response: Response, expectedLocation?: string): string; /** * Assert response has specific headers * * @param response - The Response object * @param expectedHeaders - Headers to check * @throws If any header is missing or doesn't match */ export declare function assertHeaders(response: Response, expectedHeaders: Record): void; /** * Assert response has CORS headers * * @param response - The Response object * @param origin - Expected allowed origin */ export declare function assertCorsHeaders(response: Response, origin?: string): void; /** * Assert response is JSON content type * * @param response - The Response object * @throws If Content-Type is not application/json */ export declare function assertJsonContentType(response: Response): void; //# sourceMappingURL=response.d.ts.map