diff options
| author | Billy Biggs <[email protected]> | 2025-07-08 12:57:34 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-08 16:57:34 +0000 |
| commit | c0940a194ea002742cb12d88dee9328a0d2da153 (patch) | |
| tree | d4ecc47c3a297aa1c00d6fc42616491614b4bad5 /packages/cli/src/config/config.test.ts | |
| parent | f1647d9e19bf6930bc50bd2e66d2929f8f771503 (diff) | |
Add a command line option to enable and list extensions (#3191)
Diffstat (limited to 'packages/cli/src/config/config.test.ts')
| -rw-r--r-- | packages/cli/src/config/config.test.ts | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/packages/cli/src/config/config.test.ts b/packages/cli/src/config/config.test.ts index ca5c9fdf..1ea48760 100644 --- a/packages/cli/src/config/config.test.ts +++ b/packages/cli/src/config/config.test.ts @@ -555,3 +555,41 @@ describe('loadCliConfig with allowed-mcp-server-names', () => { expect(config.getMcpServers()).toEqual(baseSettings.mcpServers); }); }); + +describe('loadCliConfig extensions', () => { + const mockExtensions: Extension[] = [ + { + config: { name: 'ext1', version: '1.0.0' }, + contextFiles: ['/path/to/ext1.md'], + }, + { + config: { name: 'ext2', version: '1.0.0' }, + contextFiles: ['/path/to/ext2.md'], + }, + ]; + + it('should not filter extensions if --extensions flag is not used', async () => { + process.argv = ['node', 'script.js']; + const settings: Settings = {}; + const config = await loadCliConfig( + settings, + mockExtensions, + 'test-session', + ); + expect(config.getExtensionContextFilePaths()).toEqual([ + '/path/to/ext1.md', + '/path/to/ext2.md', + ]); + }); + + it('should filter extensions if --extensions flag is used', async () => { + process.argv = ['node', 'script.js', '--extensions', 'ext1']; + const settings: Settings = {}; + const config = await loadCliConfig( + settings, + mockExtensions, + 'test-session', + ); + expect(config.getExtensionContextFilePaths()).toEqual(['/path/to/ext1.md']); + }); +}); |
