summaryrefslogtreecommitdiff
path: root/packages/cli/src/config/config.test.ts
diff options
context:
space:
mode:
authorTyler <[email protected]>2025-07-09 11:38:38 -0700
committerGitHub <[email protected]>2025-07-09 18:38:38 +0000
commit6c12f9e0d902c60fa5e01422018ce773c405da8d (patch)
treeb35dbfef6f33a934a74f50bc0b174f73fd00533c /packages/cli/src/config/config.test.ts
parent017a0a6c863e1dfc0f62ec0817cf84aebc6304fe (diff)
Use yargs array type for the allowedMcpServerNames flag instead of processing the list directly ourselves. (#3600)
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 35b420e9..f002fd84 100644
--- a/packages/cli/src/config/config.test.ts
+++ b/packages/cli/src/config/config.test.ts
@@ -527,7 +527,9 @@ describe('loadCliConfig with allowed-mcp-server-names', () => {
'node',
'script.js',
'--allowed-mcp-server-names',
- 'server1,server3',
+ 'server1',
+ '--allowed-mcp-server-names',
+ 'server3',
];
const config = await loadCliConfig(baseSettings, [], 'test-session');
expect(config.getMcpServers()).toEqual({
@@ -541,7 +543,9 @@ describe('loadCliConfig with allowed-mcp-server-names', () => {
'node',
'script.js',
'--allowed-mcp-server-names',
- 'server1,server4',
+ 'server1',
+ '--allowed-mcp-server-names',
+ 'server4',
];
const config = await loadCliConfig(baseSettings, [], 'test-session');
expect(config.getMcpServers()).toEqual({
@@ -549,10 +553,10 @@ describe('loadCliConfig with allowed-mcp-server-names', () => {
});
});
- it('should allow all MCP servers if the flag is an empty string', async () => {
+ it('should allow no MCP servers if the flag is provided but empty', async () => {
process.argv = ['node', 'script.js', '--allowed-mcp-server-names', ''];
const config = await loadCliConfig(baseSettings, [], 'test-session');
- expect(config.getMcpServers()).toEqual(baseSettings.mcpServers);
+ expect(config.getMcpServers()).toEqual({});
});
});