@@ -27,17 +27,21 @@ async function addTargetToWorkspace(
2727) {
2828 const { cwd, project } = options ;
2929 const projectCfg = readProjectConfiguration ( tree , project ) ;
30+ const { root } = projectCfg ;
31+ const configPath = path . join ( root , 'code-pushup.config.ts' ) ;
3032 updateProjectConfiguration ( tree , project , {
3133 ...projectCfg ,
3234 targets : {
3335 ...projectCfg . targets ,
3436 'code-pushup' : {
3537 executor : '@code-pushup/nx-plugin:cli' ,
36- ...( executorOptions && { options : executorOptions } ) ,
38+ options : {
39+ config : configPath ,
40+ ...executorOptions ,
41+ } ,
3742 } ,
3843 } ,
3944 } ) ;
40- const { root } = projectCfg ;
4145 generateCodePushupConfig ( tree , root , {
4246 plugins : [
4347 {
@@ -144,7 +148,7 @@ describe('executor command', () => {
144148 ) . resolves . not . toThrow ( ) ;
145149 } ) ;
146150
147- it ( 'should execute print-config executor with api key ' , async ( ) => {
151+ it ( 'should execute print-config executor with upload config ' , async ( ) => {
148152 const cwd = path . join ( testFileDir , 'execute-print-config-command' ) ;
149153 await addTargetToWorkspace ( tree , { cwd, project } ) ;
150154
@@ -156,6 +160,9 @@ describe('executor command', () => {
156160 `${ project } :code-pushup` ,
157161 'print-config' ,
158162 '--upload.apiKey=a123a' ,
163+ '--upload.server=https://example.com' ,
164+ '--upload.organization=test-org' ,
165+ '--upload.project=test-project' ,
159166 ] ,
160167 cwd,
161168 } ) ;
@@ -203,9 +210,15 @@ describe('executor command', () => {
203210 ) ;
204211 expect ( cleanStdout ) . toContain ( 'Code PushUp CLI' ) ;
205212
206- await expect (
207- readJsonFile ( path . join ( cwd , '.reports' , 'terminal-report.json' ) ) ,
208- ) . resolves . not . toThrow ( ) ;
213+ // Check for report in project root's .reports directory
214+ const reportPath = path . join (
215+ cwd ,
216+ 'libs' ,
217+ project ,
218+ '.reports' ,
219+ 'terminal-report.json' ,
220+ ) ;
221+ await expect ( readJsonFile ( reportPath ) ) . resolves . not . toThrow ( ) ;
209222 } ) ;
210223
211224 it ( 'should execute collect executor and add report to sub folder named by project' , async ( ) => {
@@ -223,7 +236,7 @@ describe('executor command', () => {
223236 expect ( cleanStdout ) . toContain ( 'nx run my-lib:code-pushup collect' ) ;
224237
225238 const report = await readJsonFile (
226- path . join ( cwd , '.code-pushup' , project , 'report.json' ) ,
239+ path . join ( cwd , 'libs' , project , ' .code-pushup', 'report.json' ) ,
227240 ) ;
228241 expect ( report ) . toStrictEqual (
229242 expect . objectContaining ( {
0 commit comments