crosscode: Events 3.0 builds auth-client; tests on real Postgres
- scripts/products/events.sh: packages/auth-client is installed and built (after contracts) when Events uses it, as 3.0.0 does; without it a 3.0 deploy would fail at the first sign-in through Accounts. bats test. - test:accounts runs on real Postgres for both apps with EVENTS_TEST_DATABASE_URL and ACCOUNTS_TEST_DATABASE_URL (14/14); the Accounts test harness takes a real Prisma client. - e2e/excel.spec.ts resolves excelts from the backend (hoisted in the monorepo), so the e2e suite loads again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -83,13 +83,14 @@ export type Received = { path: string; headers: http.IncomingHttpHeaders; body:
|
||||
|
||||
export type Harness = Awaited<ReturnType<typeof startHarness>>;
|
||||
|
||||
export async function startHarness(opts: { now?: () => Date } = {}) {
|
||||
/** `db`: a real Prisma client instead of the in-memory one (an empty, migrated database). */
|
||||
export async function startHarness(opts: { now?: () => Date; db?: unknown } = {}) {
|
||||
// Accounts.
|
||||
const server = http.createServer();
|
||||
const port = await listen(server);
|
||||
const publicUrl = `http://127.0.0.1:${port}`;
|
||||
const config = { ...loadConfig({ ACCOUNTS_URL: publicUrl, NODE_ENV: 'test', JOBS_ENABLED: 'false', LINKS_ALLOW_PRIVATE: 'true', HUB_URL: 'http://127.0.0.1:1' }) };
|
||||
const db = memoryDb();
|
||||
const db = (opts.db ?? memoryDb()) as MemoryDb;
|
||||
const messenger = new MemoryMessenger();
|
||||
const ctx: Ctx = createCtx(config, db as never, { messenger, now: opts.now });
|
||||
const provider = await createProvider(ctx);
|
||||
|
||||
Reference in New Issue
Block a user