summaryrefslogtreecommitdiff
path: root/packages/core/src/tools/grep.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/core/src/tools/grep.test.ts')
-rw-r--r--packages/core/src/tools/grep.test.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/core/src/tools/grep.test.ts b/packages/core/src/tools/grep.test.ts
index 62346bcd..2e018cce 100644
--- a/packages/core/src/tools/grep.test.ts
+++ b/packages/core/src/tools/grep.test.ts
@@ -9,6 +9,7 @@ import { GrepTool, GrepToolParams } from './grep.js';
import path from 'path';
import fs from 'fs/promises';
import os from 'os';
+import { Config } from '../config/config.js';
// Mock the child_process module to control grep/git grep behavior
vi.mock('child_process', () => ({
@@ -30,9 +31,13 @@ describe('GrepTool', () => {
let grepTool: GrepTool;
const abortSignal = new AbortController().signal;
+ const mockConfig = {
+ getTargetDir: () => tempRootDir,
+ } as unknown as Config;
+
beforeEach(async () => {
tempRootDir = await fs.mkdtemp(path.join(os.tmpdir(), 'grep-tool-root-'));
- grepTool = new GrepTool(tempRootDir);
+ grepTool = new GrepTool(mockConfig);
// Create some test files and directories
await fs.writeFile(