@@ -54,7 +54,7 @@ describe("Unit - ai-config command", () => {
5454 const mockFs = createMockFs ( ) ;
5555 App . container . set ( FS_TOKEN , mockFs ) ;
5656
57- configureMCP ( "cursor" ) ;
57+ configureMCP ( [ "cursor" ] ) ;
5858
5959 expect ( mockFs . writeFile ) . toHaveBeenCalledWith ( ".cursor/mcp.json" , jasmine . any ( String ) ) ;
6060 const config = writtenConfig ( mockFs ) ;
@@ -277,8 +277,10 @@ describe("Unit - ai-config command", () => {
277277 it ( "prompts for agents when --agent is not provided" , async ( ) => {
278278 App . container . set ( FS_TOKEN , createMockFs ( ) ) ;
279279 spyOn ( Util , "canPrompt" ) . and . returnValue ( true ) ;
280- spyOn ( InquirerWrapper , "checkbox" ) . and . returnValue ( Promise . resolve ( [ "claude" ] ) ) ;
281- spyOn ( InquirerWrapper , "select" ) . and . returnValue ( Promise . resolve ( "vscode" ) ) ;
280+ spyOn ( InquirerWrapper , "checkbox" ) . and . returnValues (
281+ Promise . resolve ( [ "vscode" ] ) ,
282+ Promise . resolve ( [ "claude" ] )
283+ ) ;
282284
283285 await aiConfig . default . handler ( { _ : [ "ai-config" ] , $0 : "ig" } ) ;
284286
@@ -317,8 +319,10 @@ describe("Unit - ai-config command", () => {
317319 it ( "still configures MCP when none is selected for skills" , async ( ) => {
318320 const mockFs = createMockFs ( ) ;
319321 App . container . set ( FS_TOKEN , mockFs ) ;
320- spyOn ( InquirerWrapper , "checkbox" ) . and . returnValue ( Promise . resolve ( [ "none" ] ) ) ;
321- spyOn ( InquirerWrapper , "select" ) . and . returnValue ( Promise . resolve ( "vscode" ) ) ;
322+ spyOn ( InquirerWrapper , "checkbox" ) . and . returnValues (
323+ Promise . resolve ( [ "vscode" ] ) ,
324+ Promise . resolve ( [ "none" ] )
325+ ) ;
322326
323327 await aiConfig . default . handler ( { _ : [ "ai-config" ] , $0 : "ig" } ) ;
324328
@@ -331,8 +335,10 @@ describe("Unit - ai-config command", () => {
331335 it ( "configures multiple agents when selected interactively" , async ( ) => {
332336 App . container . set ( FS_TOKEN , createMockFs ( ) ) ;
333337 spyOn ( Util , "canPrompt" ) . and . returnValue ( true ) ;
334- spyOn ( InquirerWrapper , "checkbox" ) . and . returnValue ( Promise . resolve ( [ "claude" , "cursor" ] ) ) ;
335- spyOn ( InquirerWrapper , "select" ) . and . returnValue ( Promise . resolve ( "vscode" ) ) ;
338+ spyOn ( InquirerWrapper , "checkbox" ) . and . returnValues (
339+ Promise . resolve ( [ "vscode" ] ) ,
340+ Promise . resolve ( [ "claude" , "cursor" ] )
341+ ) ;
336342
337343 await aiConfig . default . handler ( { _ : [ "ai-config" ] , $0 : "ig" } ) ;
338344
@@ -344,43 +350,46 @@ describe("Unit - ai-config command", () => {
344350
345351 it ( "skips prompt when --agent is provided" , async ( ) => {
346352 App . container . set ( FS_TOKEN , createMockFs ( ) ) ;
347- spyOn ( InquirerWrapper , "checkbox" ) ;
348- spyOn ( InquirerWrapper , "select" ) . and . returnValue ( Promise . resolve ( "vscode" ) ) ;
353+ spyOn ( InquirerWrapper , "checkbox" ) . and . returnValue ( Promise . resolve ( [ "vscode" ] ) ) ;
349354
350355 await aiConfig . default . handler ( { _ : [ "ai-config" ] , $0 : "ig" , agent : [ "cursor" ] } ) ;
351356
352- expect ( InquirerWrapper . checkbox ) . not . toHaveBeenCalled ( ) ;
357+ expect ( InquirerWrapper . checkbox ) . not . toHaveBeenCalledWith ( jasmine . objectContaining ( {
358+ message : "Which AI agents do you want to generate skills and instructions for?"
359+ } ) ) ;
353360 expect ( GoogleAnalytics . post ) . toHaveBeenCalledWith ( jasmine . objectContaining ( { ea : "agent: cursor" } ) ) ;
354361 } ) ;
355362
356363 it ( "skips assistant prompt when --assistant is provided" , async ( ) => {
357364 App . container . set ( FS_TOKEN , createMockFs ( ) ) ;
358365 spyOn ( InquirerWrapper , "checkbox" ) . and . returnValue ( Promise . resolve ( [ "claude" ] ) ) ;
359- spyOn ( InquirerWrapper , "select" ) ;
360366
361- await aiConfig . default . handler ( { _ : [ "ai-config" ] , $0 : "ig" , assistant : "cursor" } ) ;
367+ await aiConfig . default . handler ( { _ : [ "ai-config" ] , $0 : "ig" , assistant : [ "cursor" ] } ) ;
362368
363- expect ( InquirerWrapper . select ) . not . toHaveBeenCalled ( ) ;
364- expect ( ( createMockFs ( ) . writeFile as jasmine . Spy ) . calls || true ) . toBeTruthy ( ) ;
369+ expect ( InquirerWrapper . checkbox ) . toHaveBeenCalledTimes ( 1 ) ;
365370 } ) ;
366371
367372 it ( "prompts for assistant with correct message" , async ( ) => {
368373 App . container . set ( FS_TOKEN , createMockFs ( ) ) ;
369- spyOn ( InquirerWrapper , "checkbox" ) . and . returnValue ( Promise . resolve ( [ "claude" ] ) ) ;
370- spyOn ( InquirerWrapper , "select" ) . and . returnValue ( Promise . resolve ( "cursor" ) ) ;
374+ spyOn ( InquirerWrapper , "checkbox" ) . and . returnValues (
375+ Promise . resolve ( [ "cursor" ] ) ,
376+ Promise . resolve ( [ "claude" ] )
377+ ) ;
371378
372379 await aiConfig . default . handler ( { _ : [ "ai-config" ] , $0 : "ig" } ) ;
373380
374- expect ( InquirerWrapper . select ) . toHaveBeenCalledWith ( jasmine . objectContaining ( {
375- message : "Which coding assistant should MCP servers be configured for?"
381+ expect ( InquirerWrapper . checkbox ) . toHaveBeenCalledWith ( jasmine . objectContaining ( {
382+ message : "Which coding assistants should MCP servers be configured for?"
376383 } ) ) ;
377384 } ) ;
378385
379386 it ( "writes to correct config path for selected assistant" , async ( ) => {
380387 const mockFs = createMockFs ( ) ;
381388 App . container . set ( FS_TOKEN , mockFs ) ;
382- spyOn ( InquirerWrapper , "checkbox" ) . and . returnValue ( Promise . resolve ( [ "none" ] ) ) ;
383- spyOn ( InquirerWrapper , "select" ) . and . returnValue ( Promise . resolve ( "claude-code" ) ) ;
389+ spyOn ( InquirerWrapper , "checkbox" ) . and . returnValues (
390+ Promise . resolve ( [ "claude-code" ] ) ,
391+ Promise . resolve ( [ "none" ] )
392+ ) ;
384393
385394 await aiConfig . default . handler ( { _ : [ "ai-config" ] , $0 : "ig" } ) ;
386395
0 commit comments