Skip to content

Commit 3cb942e

Browse files
committed
test: add tests for graphile-llm — embedder unit tests, schema enrichment, Ollama integration
Three test suites: 1. Embedder abstraction: unit tests for buildEmbedder, buildEmbedderFromModule, buildEmbedderFromEnv 2. Schema enrichment: verifies text field on VectorNearbyInput and embeddingText on mutation inputs (requires PostgreSQL + pgvector) 3. Real Ollama embedding: tests nomic-embed-text produces correct 768-dim vectors and semantic similarity (requires Ollama) Tests gracefully skip when PostgreSQL or Ollama are not available.
1 parent 976f626 commit 3cb942e

5 files changed

Lines changed: 586 additions & 4 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
2+
module.exports = {
3+
preset: 'ts-jest',
4+
testEnvironment: 'node',
5+
testTimeout: 60000,
6+
transform: {
7+
'^.+\\.tsx?$': [
8+
'ts-jest',
9+
{
10+
babelConfig: false,
11+
tsconfig: 'tsconfig.json'
12+
}
13+
]
14+
},
15+
transformIgnorePatterns: [`/node_modules/*`],
16+
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
17+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
18+
modulePathIgnorePatterns: ['dist/*']
19+
};

graphile/graphile-llm/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@
4949
},
5050
"devDependencies": {
5151
"@types/node": "^22.19.11",
52-
"makage": "^0.3.0"
52+
"graphile-connection-filter": "workspace:^",
53+
"graphile-search": "workspace:^",
54+
"graphile-test": "workspace:^",
55+
"makage": "^0.3.0",
56+
"pgsql-test": "workspace:^"
5357
},
5458
"keywords": [
5559
"postgraphile",

0 commit comments

Comments
 (0)