import Macroable from '@poppinss/macroable'; import { IncomingMessage, ServerResponse } from 'node:http'; import { HttpServerUtils } from './http.ts'; import type { ApplicationService } from '../types.ts'; import { CookieClient, type HttpContext } from '../../modules/http/main.ts'; /** * Test utils has a collection of helper methods to make testing * experience great for AdonisJS applications. It provides utilities * for HTTP testing, context creation, and cookie handling. * * @example * const testUtils = new TestUtils(app) * await testUtils.boot() * * const ctx = await testUtils.createHttpContext() * const httpUtils = testUtils.httpServer() */ export declare class TestUtils extends Macroable { #private; app: ApplicationService; /** * Check if utils have been booted */ get isBooted(): boolean; /** * Cookie client instance for handling cookies in tests */ cookies: CookieClient; /** * Creates a new TestUtils instance * * @param app - The application service instance */ constructor(app: ApplicationService); /** * Boot test utils. It requires the app to be booted * and container to have all the bindings */ boot(): Promise; /** * Returns an instance of the HTTP server testing * utils */ httpServer(): HttpServerUtils; /** * Create an instance of HTTP context for testing * * @param options - Options for creating HTTP context with custom req/res objects */ createHttpContext(options?: { req?: IncomingMessage; res?: ServerResponse; }): Promise; }