UNPKG

@craftapit/tester

Version:

A focused, LLM-powered testing framework for natural language test scenarios

38 lines (37 loc) 1.04 kB
import { BaseAdapter } from './BaseAdapter'; export interface APIResponse { status: number; headers: Record<string, string>; body: any; } export interface APIRequest { method: string; url: string; headers?: Record<string, string>; body?: any; params?: Record<string, string>; } export declare class APIAdapter extends BaseAdapter { private baseUrl; private defaultHeaders; private lastResponse; constructor(config: { baseUrl?: string; defaultHeaders?: Record<string, string>; }); initialize(): Promise<void>; cleanup(): Promise<void>; makeRequest(request: APIRequest): Promise<APIResponse>; verifyResponse(expectations: { status?: number; bodyContains?: Record<string, any>; bodyMatches?: (body: any) => boolean; headerContains?: Record<string, string>; }): Promise<{ success: boolean; reason?: string; }>; getLastResponse(): APIResponse | null; private resolveUrl; private deepCompare; }