test(01-02): add failing Kimi runtime selection coverage

- Expect Kimi in interactive runtime option 11
- Move all-runtimes shortcut to option 17
- Cover Kimi in runtimeMap, allRuntimes and prompt text
This commit is contained in:
Viktorplus
2026-06-06 13:09:40 +02:00
parent f729101eec
commit 8c541b1f3a

View File

@@ -61,38 +61,42 @@ describe('multi-runtime selection parsing', () => {
}); });
test('single choice for kilo', () => { test('single choice for kilo', () => {
assert.deepStrictEqual(parseRuntimeInput('11'), ['kilo']); assert.deepStrictEqual(parseRuntimeInput('12'), ['kilo']);
}); });
test('single choice for opencode', () => { test('single choice for opencode', () => {
assert.deepStrictEqual(parseRuntimeInput('12'), ['opencode']); assert.deepStrictEqual(parseRuntimeInput('13'), ['opencode']);
}); });
test('single choice for qwen', () => { test('single choice for qwen', () => {
assert.deepStrictEqual(parseRuntimeInput('13'), ['qwen']); assert.deepStrictEqual(parseRuntimeInput('14'), ['qwen']);
}); });
test('single choice for trae', () => { test('single choice for trae', () => {
assert.deepStrictEqual(parseRuntimeInput('14'), ['trae']); assert.deepStrictEqual(parseRuntimeInput('15'), ['trae']);
}); });
test('single choice for windsurf', () => { test('single choice for windsurf', () => {
assert.deepStrictEqual(parseRuntimeInput('15'), ['windsurf']); assert.deepStrictEqual(parseRuntimeInput('16'), ['windsurf']);
}); });
test('choice 16 returns all runtimes', () => { test('single choice for kimi', () => {
assert.deepStrictEqual(parseRuntimeInput('16'), allRuntimes); assert.deepStrictEqual(parseRuntimeInput('11'), ['kimi']);
}); });
test('choice 16 returns all runtimes when mixed with separators or other tokens', () => { test('choice 17 returns all runtimes', () => {
// CR feedback: tokenized inputs that include 16 (e.g. trailing comma, or assert.deepStrictEqual(parseRuntimeInput('17'), allRuntimes);
});
test('choice 17 returns all runtimes when mixed with separators or other tokens', () => {
// CR feedback: tokenized inputs that include 17 (e.g. trailing comma, or
// alongside other choices) must still expand to all-runtimes — previously // alongside other choices) must still expand to all-runtimes — previously
// only the bare "16" matched, so "16," or "16 1" silently installed a // only the bare all-runtimes option matched, so "17," or "17 1" silently installed a
// subset. // subset.
assert.deepStrictEqual(parseRuntimeInput('16,'), allRuntimes); assert.deepStrictEqual(parseRuntimeInput('17,'), allRuntimes);
assert.deepStrictEqual(parseRuntimeInput('16 1'), allRuntimes); assert.deepStrictEqual(parseRuntimeInput('17 1'), allRuntimes);
assert.deepStrictEqual(parseRuntimeInput('1,16'), allRuntimes); assert.deepStrictEqual(parseRuntimeInput('1,17'), allRuntimes);
assert.deepStrictEqual(parseRuntimeInput(' 16 '), allRuntimes); assert.deepStrictEqual(parseRuntimeInput(' 17 '), allRuntimes);
}); });
test('empty input defaults to claude', () => { test('empty input defaults to claude', () => {
@@ -101,13 +105,13 @@ describe('multi-runtime selection parsing', () => {
}); });
test('invalid choices are ignored, falls back to claude if all invalid', () => { test('invalid choices are ignored, falls back to claude if all invalid', () => {
assert.deepStrictEqual(parseRuntimeInput('17'), ['claude']); assert.deepStrictEqual(parseRuntimeInput('18'), ['claude']);
assert.deepStrictEqual(parseRuntimeInput('0'), ['claude']); assert.deepStrictEqual(parseRuntimeInput('0'), ['claude']);
assert.deepStrictEqual(parseRuntimeInput('abc'), ['claude']); assert.deepStrictEqual(parseRuntimeInput('abc'), ['claude']);
}); });
test('invalid choices mixed with valid are filtered out', () => { test('invalid choices mixed with valid are filtered out', () => {
assert.deepStrictEqual(parseRuntimeInput('1,17,7'), ['claude', 'copilot']); assert.deepStrictEqual(parseRuntimeInput('1,18,7'), ['claude', 'copilot']);
assert.deepStrictEqual(parseRuntimeInput('abc 3 xyz'), ['augment']); assert.deepStrictEqual(parseRuntimeInput('abc 3 xyz'), ['augment']);
}); });
@@ -134,16 +138,17 @@ describe('install.js exports multi-select runtime metadata', () => {
'8': 'cursor', '8': 'cursor',
'9': 'gemini', '9': 'gemini',
'10': 'hermes', '10': 'hermes',
'11': 'kilo', '11': 'kimi',
'12': 'opencode', '12': 'kilo',
'13': 'qwen', '13': 'opencode',
'14': 'trae', '14': 'qwen',
'15': 'windsurf', '15': 'trae',
'16': 'windsurf',
}; };
const expectedRuntimes = [ const expectedRuntimes = [
'claude', 'antigravity', 'augment', 'cline', 'codebuddy', 'codex', 'claude', 'antigravity', 'augment', 'cline', 'codebuddy', 'codex',
'copilot', 'cursor', 'gemini', 'hermes', 'kilo', 'opencode', 'qwen', 'copilot', 'cursor', 'gemini', 'hermes', 'kimi', 'kilo', 'opencode',
'trae', 'windsurf', 'qwen', 'trae', 'windsurf',
]; ];
test('runtimeMap exports every option key bound to the right runtime', () => { test('runtimeMap exports every option key bound to the right runtime', () => {
@@ -160,20 +165,22 @@ describe('install.js exports multi-select runtime metadata', () => {
'allRuntimes has no duplicates'); 'allRuntimes has no duplicates');
}); });
test('"All" shortcut (option 16) selects every runtime', () => { test('"All" shortcut (option 17) selects every runtime', () => {
assert.deepStrictEqual(parseRuntimeInput('16'), allRuntimes); assert.deepStrictEqual(parseRuntimeInput('17'), allRuntimes);
}); });
test('prompt lists Hermes Agent (10), Qwen Code (13), Trae (14), and All (16)', () => { test('prompt lists Hermes Agent (10), Kimi (11), Qwen Code (14), Trae (15), and All (17)', () => {
const prompt = stripAnsi(buildRuntimePromptText()); const prompt = stripAnsi(buildRuntimePromptText());
assert.ok(/\b10\)\s*Hermes Agent\b/.test(prompt), assert.ok(/\b10\)\s*Hermes Agent\b/.test(prompt),
'prompt lists Hermes Agent as option 10'); 'prompt lists Hermes Agent as option 10');
assert.ok(/\b13\)\s*Qwen Code\b/.test(prompt), assert.ok(/\b11\)\s*Kimi\b/.test(prompt),
'prompt lists Qwen Code as option 13'); 'prompt lists Kimi as option 11');
assert.ok(/\b14\)\s*Trae\b/.test(prompt), assert.ok(/\b14\)\s*Qwen Code\b/.test(prompt),
'prompt lists Trae as option 14'); 'prompt lists Qwen Code as option 14');
assert.ok(/\b16\)\s*All\b/.test(prompt), assert.ok(/\b15\)\s*Trae\b/.test(prompt),
'prompt lists All as option 16'); 'prompt lists Trae as option 15');
assert.ok(/\b17\)\s*All\b/.test(prompt),
'prompt lists All as option 17');
}); });
test('prompt text shows multi-select hint', () => { test('prompt text shows multi-select hint', () => {