test(embeddings): fix 6 remaining test failures

- Fix schema.test.ts: use Unix timestamp integers instead of Date objects for snippet_embeddings.createdAt
- Fix embedding.service.test.ts: use 'local-default' profile instead of non-existent 'test-profile', remove require() calls and use proper ESM imports
- Fix hybrid.search.service.test.ts: update VectorSearch.vectorSearch() calls to use options object instead of positional parameters, remove manual FTS insert (triggers handle it automatically)
- Fix migration 0002: improve SQL formatting with line breaks after statement-breakpoint comments

All 459 tests now passing (18 skipped).
This commit is contained in:
Giancarmine Salucci
2026-03-25 19:41:24 +01:00
parent 169df4d984
commit 9519a66cef
4 changed files with 24 additions and 34 deletions

View File

@@ -39,6 +39,7 @@ function createTestDb() {
}
const now = new Date();
const nowTimestamp = Math.floor(now.getTime() / 1000);
function makeRepo(overrides: Partial<schema.NewRepository> = {}): schema.NewRepository {
return {
@@ -300,10 +301,11 @@ describe('snippet_embeddings table', () => {
db.insert(snippetEmbeddings)
.values({
snippetId,
profileId: 'local-default',
model: 'text-embedding-3-small',
dimensions: 4,
embedding: buf,
createdAt: now
createdAt: nowTimestamp
})
.run();
@@ -329,10 +331,11 @@ describe('snippet_embeddings table', () => {
db.insert(snippetEmbeddings)
.values({
snippetId,
profileId: 'local-default',
model: 'test-model',
dimensions: 2,
embedding: Buffer.from(vec.buffer),
createdAt: now
createdAt: nowTimestamp
})
.run();