/** * Runner-agnostic test setup. Plain async functions with **no test-runner * import** (no `node:test` or vitest) so the framework's test lifecycle can * also be driven programmatically. `setupNodeTest.ts` and `setupVitest.ts` * supply their respective runner hooks. * * Lifecycle pieces: * - `startTestMongo` / `stopTestMongo` — once per run; spins up an in-memory * Mongo replica set and publishes `process.env.TEST_MONGO_URI`. * - `startTestServer` / `stopTestServer` — once per test file/suite; boots a * framework `Server` against a fresh DB and tears it down. * - `setTestRedisNamespace` / `clearTestRedisNamespace` — per test; isolate the * cache/rate-limiter keyspace. * * Project `Server` options (notably the `bootHttp` hook) are declared with * `configureTestServer` from `testHelpers.ts` before the server boots; this * module owns only the `folders` config. */ import Server from '../server.ts'; /** Start an in-memory Mongo replica set and publish `TEST_MONGO_URI`. */ export declare function startTestMongo(): Promise; /** Stop the in-memory Mongo replica set. */ export declare function stopTestMongo(): Promise; /** * Return the one shared server-start promise for this test-file process. * * node:test may execute sibling root-level `before()` hooks concurrently. Both * the framework preload and application setup hooks must use this gate so they * await the same initialization instead of racing two server boots. */ export declare function ensureTestServerReady(): Promise; /** Start the per-file test server through the idempotent readiness gate. */ export declare function startTestServer(): Promise; /** * Shut down the server, drop its database, and disconnect mongoose. A failed * drop is rethrown after the connection is closed. */ export declare function stopTestServer(): Promise; /** Point the cache/rate-limiter keyspace at a fresh random namespace. */ export declare function setTestRedisNamespace(): void; /** Best-effort clear of the current test's redis namespace (no-op without redis). */ export declare function clearTestRedisNamespace(): Promise;