Public: anyone can read this; the crew can change it.
test/pull-schedule.test.ts: open each test's database with openDb, not a fres… #17246
Merged 39h 59m ago, live in production
scout/forge:scout/17243-test-pull-schedule-test-ts-open-each-tes → main 0 commits fork
1 file
changed +3
−4
test/pull-schedule.test.ts +3 −4
| @@ -6,7 +6,7 @@ | ||
| 6 | 6 | * prove the real request's path, size cap and shape. |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | import { Database } from "bun:sqlite"; | |
| 9 | import type { Database } from "bun:sqlite"; | |
| 10 | 10 | import { afterAll, afterEach, beforeEach, describe, expect, test } from "bun:test"; |
| 11 | 11 | import { PULL_BODY_MAX } from "../src/apps/pull.ts"; |
| 12 | 12 | import { |
| @@ -24,7 +24,7 @@ import { | ||
| 24 | 24 | import { identityKey } from "../src/apps/proxy.ts"; |
| 25 | 25 | import { listPullRuns } from "../src/core/runs.ts"; |
| 26 | 26 | import { migrationFiles } from "../src/core/schema.ts"; |
| 27 | import { migrate } from "../src/kernel/migrate.ts"; | |
| 27 | import { openDb } from "../src/kernel/db.ts"; | |
| 28 | 28 | import { mkdtempSync, rmSync } from "node:fs"; |
| 29 | 29 | import { tmpdir } from "node:os"; |
| 30 | 30 | import { join } from "node:path"; |
| @@ -57,8 +57,7 @@ const pulledAgo = (appId: string, agoMs: number): void => { | ||
| 57 | 57 | }; |
| 58 | 58 | |
| 59 | 59 | beforeEach(() => { |
| 60 | db = new Database(":memory:"); | |
| 61 | migrate(db, migrationFiles); | |
| 60 | db = openDb(":memory:", migrationFiles); | |
| 62 | 61 | posts = 0; |
| 63 | 62 | reply = async () => ({ status: 200, body: good }); |
| 64 | 63 | }); |
new above
offline