@@ -27,21 +27,17 @@ 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' ) ;
3230 updateProjectConfiguration ( tree , project , {
3331 ...projectCfg ,
3432 targets : {
3533 ...projectCfg . targets ,
3634 'code-pushup' : {
3735 executor : '@code-pushup/nx-plugin:cli' ,
38- options : {
39- config : configPath ,
40- ...executorOptions ,
41- } ,
36+ ...( executorOptions && { options : executorOptions } ) ,
4237 } ,
4338 } ,
4439 } ) ;
40+ const { root } = projectCfg ;
4541 generateCodePushupConfig ( tree , root , {
4642 plugins : [
4743 {
@@ -148,22 +144,19 @@ describe('executor command', () => {
148144 ) . resolves . not . toThrow ( ) ;
149145 } ) ;
150146
151- it ( 'should execute print-config executor with upload config ' , async ( ) => {
147+ it ( 'should execute print-config executor with api key ' , async ( ) => {
152148 const cwd = path . join ( testFileDir , 'execute-print-config-command' ) ;
153149 await addTargetToWorkspace ( tree , { cwd, project } ) ;
154150
155151 const { stdout, code } = await executeProcess ( {
156152 command : 'npx' ,
157- args : [
153+ args : expect . arrayContaining ( [
158154 'nx' ,
159155 'run' ,
160156 `${ project } :code-pushup` ,
161157 'print-config' ,
162158 '--upload.apiKey=a123a' ,
163- '--upload.server=https://example.com' ,
164- '--upload.organization=test-org' ,
165- '--upload.project=test-project' ,
166- ] ,
159+ ] ) ,
167160 cwd,
168161 } ) ;
169162
@@ -184,7 +177,7 @@ describe('executor command', () => {
184177 { cwd, project } ,
185178 {
186179 persist : {
187- outputDir : path . join ( 'libs' , project , ' .reports') ,
180+ outputDir : ' .reports',
188181 filename : 'report' ,
189182 } ,
190183 } ,
@@ -210,15 +203,9 @@ describe('executor command', () => {
210203 ) ;
211204 expect ( cleanStdout ) . toContain ( 'Code PushUp CLI' ) ;
212205
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 ( ) ;
206+ await expect (
207+ readJsonFile ( path . join ( cwd , '.reports' , 'terminal-report.json' ) ) ,
208+ ) . resolves . not . toThrow ( ) ;
222209 } ) ;
223210
224211 it ( 'should execute collect executor and add report to sub folder named by project' , async ( ) => {
@@ -236,7 +223,7 @@ describe('executor command', () => {
236223 expect ( cleanStdout ) . toContain ( 'nx run my-lib:code-pushup collect' ) ;
237224
238225 const report = await readJsonFile (
239- path . join ( cwd , 'libs' , project , ' .code-pushup', project , 'report.json' ) ,
226+ path . join ( cwd , '.code-pushup' , project , 'report.json' ) ,
240227 ) ;
241228 expect ( report ) . toStrictEqual (
242229 expect . objectContaining ( {
0 commit comments