File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ( ) => {
You can’t perform that action at this time.
0 commit comments