refactor(test): migrate 4 remaining multi-backend test files to createTestDb helper#3520
Conversation
…lper Replaces hand-rolled SQLITE_CREATE DDL with createTestDb() in misc.test.ts, neighbors.test.ts, notifications.test.ts, and traceroutes.test.ts so their SQLite path runs against the real migration-built schema rather than a stale copy. Fixed: insertNodeSql for SQLite now includes nodeId (NOT NULL) and sourceId (composite PK); insertMessageSql includes createdAt (NOT NULL); user_news_status tests seed a FK-required user since migration 041 leaves foreign_keys=ON. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job PR Review —
|
Summary
misc.test.ts,neighbors.test.ts,notifications.test.ts, andtraceroutes.test.tsfrom hand-rolledSQLITE_CREATEDDL tocreateTestDb()(the real migration-built in-memory SQLite schema)createTestDb()for their SQLite pathNotable fixes
insertNodeSqlin notifications.test.ts: addsnodeId(NOT NULL) andsourceId(composite PK component) required by the real schemainsertMessageSqlin notifications.test.ts: addscreatedAt(NOT NULL in real schema)misc.test.ts: seeds a user beforesaveUserNewsStatustests because migration 041 leavesforeign_keys=ONand the real schema has a FK fromuser_news_status.userId → users.idTest plan
vitest run src/db/repositories/{misc,neighbors,notifications,traceroutes}.test.ts🤖 Generated with Claude Code