Skip to content

Commit a4ea714

Browse files
committed
fix(server-test): pgvector test checks ok:false instead of rejection
The CLI exits with code 0 even on GraphQL errors, returning { ok: false, errors: [...] }. Updated the test to check the response content instead of expecting the promise to reject.
1 parent 62ac909 commit a4ea714

1 file changed

Lines changed: 16 additions & 12 deletions

File tree

graphql/server-test/__tests__/cli-e2e.test.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -996,18 +996,22 @@ describe('CLI E2E — search commands against real DB', () => {
996996

997997
// CLI dot-notation sends "[0.1,0.9,0.3]" as a string, not a vector.
998998
// The GraphQL server should reject it with a type error.
999-
await expect(
1000-
runCli(
1001-
'article',
1002-
'list',
1003-
'--where.vectorEmbedding.vector',
1004-
'[0.1,0.9,0.3]',
1005-
'--where.vectorEmbedding.distance',
1006-
'1.0',
1007-
'--fields',
1008-
'title,embeddingVectorDistance',
1009-
),
1010-
).rejects.toThrow();
999+
// The CLI still exits 0 but returns { ok: false, errors: [...] }.
1000+
const output = await runCli(
1001+
'article',
1002+
'list',
1003+
'--where.vectorEmbedding.vector',
1004+
'[0.1,0.9,0.3]',
1005+
'--where.vectorEmbedding.distance',
1006+
'1.0',
1007+
'--fields',
1008+
'title,embeddingVectorDistance',
1009+
);
1010+
1011+
const raw = JSON.parse(output);
1012+
expect(raw.ok).toBe(false);
1013+
expect(raw.errors).toBeDefined();
1014+
expect(raw.errors.length).toBeGreaterThanOrEqual(1);
10111015
});
10121016

10131017
// =========================================================================

0 commit comments

Comments
 (0)