feat: add http smoke tests.

This commit is contained in:
killian-larcher
2026-06-14 17:58:17 +02:00
parent 25689b6e0d
commit f2b7e4bfff
17 changed files with 631 additions and 107 deletions
+29
View File
@@ -0,0 +1,29 @@
import { existsSync, readFileSync, writeFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
export type ApiTestContext = {
baseUrl: string;
authCookie: string;
apiKey: string;
userEmail: string;
agentId: string | null;
databaseId: string | null;
backupId: string | null;
backupStorageId: string | null;
};
export const CONTEXT_PATH = fileURLToPath(
new URL("../.runtime-context.json", import.meta.url),
);
export function writeContext(context: ApiTestContext) {
writeFileSync(CONTEXT_PATH, JSON.stringify(context, null, 2), "utf8");
}
export function readContext(): ApiTestContext {
if (!existsSync(CONTEXT_PATH)) {
throw new Error(`Missing API test context at ${CONTEXT_PATH}`);
}
return JSON.parse(readFileSync(CONTEXT_PATH, "utf8")) as ApiTestContext;
}