diff options
| author | Tommaso Sciortino <[email protected]> | 2025-07-14 22:55:49 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-15 05:55:49 +0000 |
| commit | fefa7ecbea2ab985e48679ceb3010a174777a188 (patch) | |
| tree | 94777677e2e7e0c72e8f75941d8594b898e67192 /packages/core/src/tools/grep.test.ts | |
| parent | e584241141b74ab503a527fad158d60eb06c38fe (diff) | |
Pure refactor: Consolidate isWithinRoot() function calling. (#4163)
Diffstat (limited to 'packages/core/src/tools/grep.test.ts')
| -rw-r--r-- | packages/core/src/tools/grep.test.ts | 7 |
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( |
