export declare function setupTestEnvironment(): void; export declare function featureTest(baseUrl?: string): FeatureTestClient; /** * Lightweight feature-test helper. Returns a fluent client that wraps * the request flow (`actingAs`, `json`, `assertStatus`, etc.) so test * files don't have to re-implement boilerplate around `serverResponse`. * * Tests that need raw `fetch`-style access can still call the underlying * server entrypoint directly — the helper is purely additive. * * @example * ```ts * import { featureTest, refreshDatabase } from '@stacksjs/testing' * * test('create post', async () => { * await refreshDatabase() * const user = await User.create({ email: 'a@b.com' }) * * const res = await featureTest() * .actingAs(user) * .post('/api/posts', { title: 'hello' }) * * res.assertStatus(201) * const body = await res.json<{ id: number, title: string }>() * expect(body.title).toBe('hello') * }) * ``` */ export declare interface FeatureTestResponse { status: number headers: Headers text: () => Promise json: () => Promise assertStatus: (expected: number) => FeatureTestResponse assertJson: >(partial: T) => Promise assertHeader: (name: string, expected?: string | RegExp) => FeatureTestResponse } export declare interface FeatureTestClient { actingAs: (user: { id: number | string, [k: string]: unknown }) => FeatureTestClient withHeaders: (headers: Record) => FeatureTestClient get: (path: string) => Promise post: (path: string, body?: unknown) => Promise put: (path: string, body?: unknown) => Promise patch: (path: string, body?: unknown) => Promise delete: (path: string, body?: unknown) => Promise }