mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-11 17:00:22 +00:00
15 lines
795 B
TypeScript
15 lines
795 B
TypeScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { resolveAgentHostWorkspace } from './agentHostWorkspace';
|
|
|
|
test('current resolves only to an existing workspace, not a terminal tab', () => {
|
|
assert.deepEqual(resolveAgentHostWorkspace('current', 'ws-1', ['ws-1']), { workspaceId: 'ws-1' });
|
|
assert.match(resolveAgentHostWorkspace('current', 'terminal-1', ['ws-1']).error ?? '', /workspace/i);
|
|
});
|
|
|
|
test('explicit missing workspace is rejected without standalone fallback', () => {
|
|
assert.match(resolveAgentHostWorkspace('missing', 'ws-1', ['ws-1']).error ?? '', /workspace/i);
|
|
assert.deepEqual(resolveAgentHostWorkspace('ws-1', 'other', ['ws-1']), { workspaceId: 'ws-1' });
|
|
assert.deepEqual(resolveAgentHostWorkspace(undefined, 'ws-1', ['ws-1']), {});
|
|
});
|