summaryrefslogtreecommitdiff
path: root/packages/cli/src/config/config.test.ts
diff options
context:
space:
mode:
authorShreya Keshive <[email protected]>2025-07-17 12:59:57 -0400
committerGitHub <[email protected]>2025-07-17 16:59:57 +0000
commit88b5f209432c06c58b8bdf78d69ac5fccb26838f (patch)
treedfbb6983be1069131139375e2ab1f23b21b8bb6d /packages/cli/src/config/config.test.ts
parent79d36ac0a54c17a877264eb4d532854eb51e2e42 (diff)
Update companionPort not existing to be a warning so the user can still proceed with running /ide install (#4382)
Diffstat (limited to 'packages/cli/src/config/config.test.ts')
-rw-r--r--packages/cli/src/config/config.test.ts12
1 files changed, 8 insertions, 4 deletions
diff --git a/packages/cli/src/config/config.test.ts b/packages/cli/src/config/config.test.ts
index cd06f5dc..39259fe1 100644
--- a/packages/cli/src/config/config.test.ts
+++ b/packages/cli/src/config/config.test.ts
@@ -947,16 +947,20 @@ describe('loadCliConfig ideMode', () => {
expect(mcpServers['_ide_server'].trust).toBe(false);
});
- it('should throw an error if ideMode is true and no port is set', async () => {
+ it('should warn if ideMode is true and no port is set', async () => {
+ const consoleWarnSpy = vi
+ .spyOn(console, 'warn')
+ .mockImplementation(() => {});
process.argv = ['node', 'script.js', '--ide-mode'];
const argv = await parseArguments();
process.env.TERM_PROGRAM = 'vscode';
const settings: Settings = {};
- await expect(
- loadCliConfig(settings, [], 'test-session', argv),
- ).rejects.toThrow(
+ await loadCliConfig(settings, [], 'test-session', argv);
+ expect(consoleWarnSpy).toHaveBeenCalledWith(
+ '[WARN]',
'Could not connect to IDE. Make sure you have the companion VS Code extension installed from the marketplace or via /ide install.',
);
+ consoleWarnSpy.mockRestore();
});
it('should warn and overwrite if settings contain the reserved _ide_server name and ideMode is active', async () => {