@@ -100,25 +100,6 @@ describe('executor command', () => {
100100 expect ( cleanStdout ) . toContain ( 'nx run my-lib:code-pushup' ) ;
101101 } ) ;
102102
103- it ( 'should execute print-config executor' , async ( ) => {
104- const cwd = path . join ( testFileDir , 'execute-print-config-command' ) ;
105- await addTargetToWorkspace ( tree , { cwd, project } ) ;
106-
107- const { stdout, code } = await executeProcess ( {
108- command : 'npx' ,
109- args : [ 'nx' , 'run' , `${ project } :code-pushup` , 'print-config' ] ,
110- cwd,
111- } ) ;
112-
113- expect ( code ) . toBe ( 0 ) ;
114- const cleanStdout = removeColorCodes ( stdout ) ;
115- expect ( cleanStdout ) . toContain ( 'nx run my-lib:code-pushup print-config' ) ;
116-
117- await expect ( ( ) =>
118- readJsonFile ( path . join ( cwd , '.code-pushup' , project , 'report.json' ) ) ,
119- ) . rejects . toThrow ( '' ) ;
120- } ) ;
121-
122103 it ( 'should execute print-config executor with output' , async ( ) => {
123104 const cwd = path . join ( testFileDir , 'execute-print-config-command' ) ;
124105 await addTargetToWorkspace ( tree , { cwd, project } ) ;
@@ -155,6 +136,7 @@ describe('executor command', () => {
155136 'run' ,
156137 `${ project } :code-pushup` ,
157138 'print-config' ,
139+ '--output=code-pushup.config.json' ,
158140 '--upload.apiKey=a123a' ,
159141 ] ,
160142 cwd,
@@ -163,11 +145,14 @@ describe('executor command', () => {
163145 expect ( code ) . toBe ( 0 ) ;
164146 const cleanStdout = removeColorCodes ( stdout ) ;
165147 expect ( cleanStdout ) . toContain ( 'nx run my-lib:code-pushup print-config' ) ;
166- expect ( cleanStdout ) . toContain ( 'a123a' ) ;
167148
168- await expect ( ( ) =>
169- readJsonFile ( path . join ( cwd , '.code-pushup' , project , 'report.json' ) ) ,
170- ) . rejects . toThrow ( '' ) ;
149+ await expect (
150+ readJsonFile ( path . join ( cwd , 'code-pushup.config.json' ) ) ,
151+ ) . resolves . toEqual (
152+ expect . objectContaining ( {
153+ upload : expect . objectContaining ( { apiKey : 'a123a' } ) ,
154+ } ) ,
155+ ) ;
171156 } ) ;
172157
173158 it ( 'should execute collect executor and merge target and command-line options' , async ( ) => {
0 commit comments