Skip to content

Commit bdf1306

Browse files
committed
test(openspec): fix kimi tool id test mock and assertion
1 parent 80132b5 commit bdf1306

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

test/ts/openspec.test.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,22 @@ describe('openspec', () => {
4040

4141
describe('installOpenSpec', () => {
4242
it('accepts the Kimi OpenSpec tool id from platform definitions', async () => {
43-
mockedExecSync.mockReturnValueOnce(Buffer.from('/usr/bin/openspec'));
44-
mockedExecSync.mockReturnValueOnce(Buffer.from('ok'));
43+
mockedExecFileSync.mockReturnValueOnce(Buffer.from('/usr/bin/openspec'));
44+
mockedExecFileSync.mockReturnValueOnce(Buffer.from('ok'));
4545

46-
const { installOpenSpec, quoteShellArg } = await import('../../src/core/openspec.js');
46+
const { installOpenSpec } = await import('../../src/core/openspec.js');
4747
const result = await installOpenSpec('/tmp/test', ['kimi'], 'project');
4848

4949
expect(result).toBe('installed');
50-
expect(mockedExecSync.mock.calls[1][0]).toContain(`--tools ${quoteShellArg('kimi')}`);
50+
expect(mockedExecFileSync.mock.calls[1][0]).toBe('openspec');
51+
expect(mockedExecFileSync.mock.calls[1][1]).toEqual([
52+
'init',
53+
'/tmp/test',
54+
'--tools',
55+
'kimi',
56+
'--profile',
57+
'custom',
58+
]);
5159
});
5260

5361
it('installs openspec when CLI is available', async () => {

0 commit comments

Comments
 (0)