summaryrefslogtreecommitdiff
path: root/packages/core/src/tools/glob.test.ts
diff options
context:
space:
mode:
authorTommaso Sciortino <[email protected]>2025-07-14 22:55:49 -0700
committerGitHub <[email protected]>2025-07-15 05:55:49 +0000
commitfefa7ecbea2ab985e48679ceb3010a174777a188 (patch)
tree94777677e2e7e0c72e8f75941d8594b898e67192 /packages/core/src/tools/glob.test.ts
parente584241141b74ab503a527fad158d60eb06c38fe (diff)
Pure refactor: Consolidate isWithinRoot() function calling. (#4163)
Diffstat (limited to 'packages/core/src/tools/glob.test.ts')
-rw-r--r--packages/core/src/tools/glob.test.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/core/src/tools/glob.test.ts b/packages/core/src/tools/glob.test.ts
index acda3729..c63b41cc 100644
--- a/packages/core/src/tools/glob.test.ts
+++ b/packages/core/src/tools/glob.test.ts
@@ -22,12 +22,13 @@ describe('GlobTool', () => {
const mockConfig = {
getFileService: () => new FileDiscoveryService(tempRootDir),
getFileFilteringRespectGitIgnore: () => true,
- } as Partial<Config> as Config;
+ getTargetDir: () => tempRootDir,
+ } as unknown as Config;
beforeEach(async () => {
// Create a unique root directory for each test run
tempRootDir = await fs.mkdtemp(path.join(os.tmpdir(), 'glob-tool-root-'));
- globTool = new GlobTool(tempRootDir, mockConfig);
+ globTool = new GlobTool(mockConfig);
// Create some test files and directories within this root
// Top-level files
@@ -224,8 +225,8 @@ describe('GlobTool', () => {
it("should return error if search path resolves outside the tool's root directory", () => {
// Create a globTool instance specifically for this test, with a deeper root
- const deeperRootDir = path.join(tempRootDir, 'sub');
- const specificGlobTool = new GlobTool(deeperRootDir, mockConfig);
+ tempRootDir = path.join(tempRootDir, 'sub');
+ const specificGlobTool = new GlobTool(mockConfig);
// const params: GlobToolParams = { pattern: '*.txt', path: '..' }; // This line is unused and will be removed.
// This should be fine as tempRootDir is still within the original tempRootDir (the parent of deeperRootDir)
// Let's try to go further up.