@@ -466,7 +466,7 @@ describe("ensureIndexFile()", () => {
466466 recursive : true ,
467467 } ) ;
468468 expect ( fs . writeFileSync ) . toHaveBeenCalledWith (
469- path . join ( process . cwd ( ) , "src/icons/index.ts " ) ,
469+ path . join ( process . cwd ( ) , "src/icons/index.tsx " ) ,
470470 expect . stringContaining ( "react-native-svg" )
471471 ) ;
472472 } ) ;
@@ -482,7 +482,7 @@ describe("ensureIndexFile()", () => {
482482 ensureIndexFile ( config ) ;
483483
484484 expect ( fs . writeFileSync ) . toHaveBeenCalledWith (
485- path . join ( process . cwd ( ) , "src/icons/index.ts " ) ,
485+ path . join ( process . cwd ( ) , "src/icons/index.tsx " ) ,
486486 expect . not . stringContaining ( "react-native-svg" )
487487 ) ;
488488 } ) ;
@@ -527,7 +527,7 @@ describe("appendIconExport()", () => {
527527 appendIconExport ( nativeConfig , "home" ) ;
528528
529529 expect ( fs . appendFileSync ) . toHaveBeenCalledWith (
530- path . join ( process . cwd ( ) , "src/icons/index.ts " ) ,
530+ path . join ( process . cwd ( ) , "src/icons/index.tsx " ) ,
531531 '\nexport * from "./home";\n'
532532 ) ;
533533 } ) ;
@@ -538,7 +538,7 @@ describe("appendIconExport()", () => {
538538 appendIconExport ( reactConfig , "home" ) ;
539539
540540 expect ( fs . appendFileSync ) . toHaveBeenCalledWith (
541- path . join ( process . cwd ( ) , "src/icons/index.ts " ) ,
541+ path . join ( process . cwd ( ) , "src/icons/index.tsx " ) ,
542542 '\nexport { HomeIcon } from "./home";\n'
543543 ) ;
544544 } ) ;
@@ -667,15 +667,28 @@ describe("printInitSuccess()", () => {
667667 consoleLogSpy . mockRestore ( ) ;
668668 } ) ;
669669
670- it ( "Prints formatted success message" , ( ) => {
670+ it ( "Prints formatted success message with chalk colors " , ( ) => {
671671 printInitSuccess ( ) ;
672672
673- expect ( consoleLogSpy ) . toHaveBeenCalledWith ( "Commands you can run:" ) ;
674- expect ( consoleLogSpy ) . toHaveBeenCalledWith (
675- ` npx ${ LIB_NAME } browse Search pixelarticons website`
673+ expect ( consoleLogSpy ) . toHaveBeenCalledTimes ( 5 ) ;
674+ expect ( consoleLogSpy ) . toHaveBeenNthCalledWith (
675+ 1 ,
676+ expect . stringContaining ( "--------------------------------" )
676677 ) ;
677- expect ( consoleLogSpy ) . toHaveBeenCalledWith (
678- ` npx ${ LIB_NAME } add [icon-1] [icon-2] ... Add icons to your project`
678+ expect ( consoleLogSpy ) . toHaveBeenNthCalledWith ( 2 , expect . any ( String ) , "Commands you can run:" ) ;
679+ expect ( consoleLogSpy ) . toHaveBeenNthCalledWith (
680+ 3 ,
681+ expect . any ( String ) ,
682+ `npx ${ LIB_NAME } browse Search pixelarticons website`
683+ ) ;
684+ expect ( consoleLogSpy ) . toHaveBeenNthCalledWith (
685+ 4 ,
686+ expect . any ( String ) ,
687+ `npx ${ LIB_NAME } add [icon-1] [icon-2] ... Add icons to your project`
688+ ) ;
689+ expect ( consoleLogSpy ) . toHaveBeenNthCalledWith (
690+ 5 ,
691+ expect . stringContaining ( "--------------------------------" )
679692 ) ;
680693 } ) ;
681694} ) ;
0 commit comments