Skip to content

Commit a231a42

Browse files
alexandre-mrtclaude
andcommitted
test: add DB index and journal mode tests (131 tests)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 692d5f8 commit a231a42

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/db-indexes.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { describe, expect, test } from "bun:test";
2+
3+
process.env.DATABASE_URL = ":memory:";
4+
const { db } = await import("../src/services/db");
5+
6+
describe("DB indexes", () => {
7+
test("has index on drops.id", () => {
8+
const indexes = db.prepare("PRAGMA index_list(drops)").all();
9+
expect((indexes as any[]).length).toBeGreaterThan(0);
10+
});
11+
12+
test("journal mode is set", () => {
13+
const result = db.prepare("PRAGMA journal_mode").get() as { journal_mode: string };
14+
expect(["wal","memory"]).toContain(result.journal_mode);
15+
});
16+
});

0 commit comments

Comments
 (0)