diff options
Diffstat (limited to 'packages/core/src/tools/ls.test.ts')
| -rw-r--r-- | packages/core/src/tools/ls.test.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/core/src/tools/ls.test.ts b/packages/core/src/tools/ls.test.ts index c0b553e1..088edb53 100644 --- a/packages/core/src/tools/ls.test.ts +++ b/packages/core/src/tools/ls.test.ts @@ -23,6 +23,7 @@ import { LSTool } from './ls.js'; import { Config } from '../config/config.js'; import { WorkspaceContext } from '../utils/workspaceContext.js'; import { FileDiscoveryService } from '../services/fileDiscoveryService.js'; +import { ToolErrorType } from './tool-error.js'; describe('LSTool', () => { let lsTool: LSTool; @@ -288,6 +289,7 @@ describe('LSTool', () => { expect(result.llmContent).toContain('Path is not a directory'); expect(result.returnDisplay).toBe('Error: Path is not a directory.'); + expect(result.error?.type).toBe(ToolErrorType.PATH_IS_NOT_A_DIRECTORY); }); it('should handle non-existent paths', async () => { @@ -302,6 +304,7 @@ describe('LSTool', () => { expect(result.llmContent).toContain('Error listing directory'); expect(result.returnDisplay).toBe('Error: Failed to list directory.'); + expect(result.error?.type).toBe(ToolErrorType.LS_EXECUTION_ERROR); }); it('should sort directories first, then files alphabetically', async () => { @@ -357,6 +360,7 @@ describe('LSTool', () => { expect(result.llmContent).toContain('Error listing directory'); expect(result.llmContent).toContain('permission denied'); expect(result.returnDisplay).toBe('Error: Failed to list directory.'); + expect(result.error?.type).toBe(ToolErrorType.LS_EXECUTION_ERROR); }); it('should throw for invalid params at build time', async () => { |
