Skip to content

Commit f1ddb98

Browse files
committed
Add get_check tool test
1 parent 32ddbaf commit f1ddb98

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "directory-indexer",
3-
"version": "0.0.15",
3+
"version": "0.0.16",
44
"description": "AI-powered directory indexing with semantic search for MCP servers",
55
"main": "dist/cli.js",
66
"bin": {

tests/integration.test.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { join } from 'path';
44
import { existsSync } from 'fs';
55
import { loadConfig } from '../src/config.js';
66
import { indexDirectories, scanDirectory, getFileMetadata, chunkText } from '../src/indexing.js';
7-
import { searchContent, findSimilarFiles, getFileContent } from '../src/search.js';
7+
import { searchContent, findSimilarFiles, getFileContent, getChunkContent } from '../src/search.js';
88
import { getIndexStatus, SQLiteStorage, QdrantClient } from '../src/storage.js';
99
import { startMcpServer } from '../src/mcp.js';
1010
import { createEmbeddingProvider } from '../src/embedding.js';
@@ -249,6 +249,17 @@ describe.sequential('Directory Indexer Integration Tests', () => {
249249
expect(typeof chunkedContent).toBe('string');
250250
}
251251

252+
// 6. Test getChunkContent function
253+
if (searchResults.length > 0 && searchResults[0].chunks.length > 0) {
254+
console.log('🔄 Testing getChunkContent() directly...');
255+
const firstResult = searchResults[0];
256+
const firstChunk = firstResult.chunks[0];
257+
258+
const chunkContent = await getChunkContent(firstResult.filePath, firstChunk.chunkId);
259+
expect(typeof chunkContent).toBe('string');
260+
expect(chunkContent.length).toBeGreaterThan(0);
261+
}
262+
252263
console.log('✅ Direct function workflow completed successfully');
253264
});
254265
});

0 commit comments

Comments
 (0)