@@ -67,12 +67,11 @@ describe('CLI Integration Tests', () => {
6767
6868 describe ( 'Configuration Generation' , ( ) => {
6969 it ( 'should generate nextjs-15 configuration successfully' , async ( ) => {
70- const result = execSync ( `node "${ CLI_PATH } " nextjs-15 --no-backup --no-gitignore` , {
70+ const result = execSync ( `node "${ CLI_PATH } " nextjs-15 --no-backup --no-gitignore --output " ${ testDir } " ` , {
7171 encoding : 'utf8' ,
72- cwd : testDir ,
7372 } ) ;
7473
75- expect ( result ) . toContain ( 'Configuration generated in current directory ' ) ;
74+ expect ( result ) . toContain ( 'Configuration generated in' ) ;
7675
7776 // Check that .claude directory was created
7877 const claudeDir = path . join ( testDir , '.claude' ) ;
@@ -96,12 +95,11 @@ describe('CLI Integration Tests', () => {
9695 } ) ;
9796
9897 it ( 'should generate shadcn configuration successfully' , async ( ) => {
99- const result = execSync ( `node "${ CLI_PATH } " shadcn --no-backup --no-gitignore` , {
98+ const result = execSync ( `node "${ CLI_PATH } " shadcn --no-backup --no-gitignore --output " ${ testDir } " ` , {
10099 encoding : 'utf8' ,
101- cwd : testDir ,
102100 } ) ;
103101
104- expect ( result ) . toContain ( 'Configuration generated in current directory ' ) ;
102+ expect ( result ) . toContain ( 'Configuration generated in' ) ;
105103
106104 const claudeDir = path . join ( testDir , '.claude' ) ;
107105 expect ( fsSync . existsSync ( claudeDir ) ) . toBe ( true ) ;
@@ -114,12 +112,11 @@ describe('CLI Integration Tests', () => {
114112 } ) ;
115113
116114 it ( 'should merge multiple configurations correctly' , async ( ) => {
117- const result = execSync ( `node "${ CLI_PATH } " nextjs-15 shadcn --no-backup --no-gitignore` , {
115+ const result = execSync ( `node "${ CLI_PATH } " nextjs-15 shadcn --no-backup --no-gitignore --output " ${ testDir } " ` , {
118116 encoding : 'utf8' ,
119- cwd : testDir ,
120117 } ) ;
121118
122- expect ( result ) . toContain ( 'Configuration generated in current directory ' ) ;
119+ expect ( result ) . toContain ( 'Configuration generated in' ) ;
123120
124121 const _claudeDir = path . join ( testDir , '.claude' ) ;
125122 const claudeMd = await fs . readFile ( path . join ( testDir , 'CLAUDE.md' ) , 'utf8' ) ;
@@ -137,12 +134,11 @@ describe('CLI Integration Tests', () => {
137134 await fs . mkdir ( existingClaudeDir , { recursive : true } ) ;
138135 await fs . writeFile ( path . join ( existingClaudeDir , 'test.txt' ) , 'existing content' ) ;
139136
140- const result = execSync ( `node "${ CLI_PATH } " nextjs-15 --no-gitignore` , {
137+ const result = execSync ( `node "${ CLI_PATH } " nextjs-15 --no-gitignore --output " ${ testDir } " ` , {
141138 encoding : 'utf8' ,
142- cwd : testDir ,
143139 } ) ;
144140
145- expect ( result ) . toContain ( 'Configuration generated in current directory ' ) ;
141+ expect ( result ) . toContain ( 'Configuration generated in' ) ;
146142
147143 // Check that backup was created
148144 const files = await fs . readdir ( testDir ) ;
@@ -158,12 +154,11 @@ describe('CLI Integration Tests', () => {
158154 } ) ;
159155
160156 it ( 'should handle gitignore addition' , async ( ) => {
161- const result = execSync ( `node "${ CLI_PATH } " nextjs-15 --no-backup` , {
157+ const result = execSync ( `node "${ CLI_PATH } " nextjs-15 --no-backup --output " ${ testDir } " ` , {
162158 encoding : 'utf8' ,
163- cwd : testDir ,
164159 } ) ;
165160
166- expect ( result ) . toContain ( 'Configuration generated in current directory ' ) ;
161+ expect ( result ) . toContain ( 'Configuration generated in' ) ;
167162
168163 // Check that .gitignore was created/updated
169164 const gitignorePath = path . join ( testDir , '.gitignore' ) ;
@@ -177,9 +172,8 @@ describe('CLI Integration Tests', () => {
177172 describe ( 'Error Handling' , ( ) => {
178173 it ( 'should handle invalid configuration names gracefully' , ( ) => {
179174 expect ( ( ) => {
180- execSync ( `node "${ CLI_PATH } " invalid-config --no-backup --no-gitignore` , {
175+ execSync ( `node "${ CLI_PATH } " invalid-config --no-backup --no-gitignore --output " ${ testDir } " ` , {
181176 encoding : 'utf8' ,
182- cwd : testDir ,
183177 } ) ;
184178 } ) . toThrow ( ) ;
185179 } ) ;
@@ -192,9 +186,8 @@ describe('CLI Integration Tests', () => {
192186
193187 try {
194188 expect ( ( ) => {
195- execSync ( `node "${ CLI_PATH } " nextjs-15 --no-backup --no-gitignore` , {
189+ execSync ( `node "${ CLI_PATH } " nextjs-15 --no-backup --no-gitignore --output " ${ restrictedDir } " ` , {
196190 encoding : 'utf8' ,
197- cwd : restrictedDir ,
198191 } ) ;
199192 } ) . toThrow ( ) ;
200193 } finally {
@@ -228,7 +221,7 @@ describe('CLI Integration Tests', () => {
228221 cwd : nestedDir ,
229222 } ) ;
230223
231- expect ( result ) . toContain ( 'Configuration generated in current directory ' ) ;
224+ expect ( result ) . toContain ( 'Configuration generated in' ) ;
232225 expect ( fsSync . existsSync ( path . join ( nestedDir , '.claude' ) ) ) . toBe ( true ) ;
233226 } ) ;
234227
0 commit comments