mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 10:38:59 +01:00
Align browseDirectory errors with filesystem semantics (Written by Copilot)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
import assert from 'assert';
|
||||
import { DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js';
|
||||
import { observableValue } from '../../../../base/common/observable.js';
|
||||
import { URI } from '../../../../base/common/uri.js';
|
||||
import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js';
|
||||
import { NullLogService } from '../../../log/common/log.js';
|
||||
import { AgentSession, IAgent } from '../../common/agentService.js';
|
||||
@@ -269,6 +270,25 @@ suite('AgentSideEffects', () => {
|
||||
});
|
||||
});
|
||||
|
||||
// ---- handleBrowseDirectory ------------------------------------------
|
||||
|
||||
suite('handleBrowseDirectory', () => {
|
||||
|
||||
test('throws when the directory does not exist', async () => {
|
||||
await assert.rejects(
|
||||
() => sideEffects.handleBrowseDirectory(URI.file('/path/that/does/not/exist')),
|
||||
/Directory not found/,
|
||||
);
|
||||
});
|
||||
|
||||
test('throws when the target is not a directory', async () => {
|
||||
await assert.rejects(
|
||||
() => sideEffects.handleBrowseDirectory(URI.file('/Users/roblou/code/vscode/package.json')),
|
||||
/Not a directory/,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
// ---- agents observable --------------------------------------------------
|
||||
|
||||
suite('agents observable', () => {
|
||||
|
||||
Reference in New Issue
Block a user