@@ -51,6 +51,7 @@ describe('Logger', () => {
5151 vi . stubEnv ( 'CI' , 'false' ) ;
5252 vi . stubEnv ( 'GITHUB_ACTIONS' , 'false' ) ;
5353 vi . stubEnv ( 'GITLAB_CI' , 'false' ) ;
54+ vi . stubEnv ( 'NX_TASK_TARGET_TARGET' , '' ) ;
5455 } ) ;
5556
5657 afterAll ( ( ) => {
@@ -247,6 +248,28 @@ ${ansis.cyan('└')} ${ansis.green(`Total line coverage is ${ansis.bold('82%')}`
247248└ ESLint reported 4 errors and 11 warnings (1.23 s)
248249::endgroup::
249250
251+ ` ) ;
252+ } ) ;
253+
254+ it ( 'should NOT use native GitHub Actions log groups if run within Nx target' , async ( ) => {
255+ vi . stubEnv ( 'CI' , 'true' ) ;
256+ vi . stubEnv ( 'GITHUB_ACTIONS' , 'true' ) ;
257+ vi . stubEnv ( 'NX_TASK_TARGET_TARGET' , 'code-pushup' ) ;
258+ performanceNowSpy . mockReturnValueOnce ( 0 ) . mockReturnValueOnce ( 1234 ) ; // group duration: 1.23 s
259+ const logger = new Logger ( ) ;
260+
261+ await logger . group ( 'Running plugin "ESLint"' , async ( ) => {
262+ logger . info ( '$ npx eslint . --format=json' ) ;
263+ logger . warn ( 'Skipping unknown rule "deprecation/deprecation"' ) ;
264+ return 'ESLint reported 4 errors and 11 warnings' ;
265+ } ) ;
266+
267+ expect ( ansis . strip ( stdout ) ) . toBe ( `
268+ ❯ Running plugin "ESLint"
269+ │ $ npx eslint . --format=json
270+ │ Skipping unknown rule "deprecation/deprecation"
271+ └ ESLint reported 4 errors and 11 warnings (1.23 s)
272+
250273` ) ;
251274 } ) ;
252275
0 commit comments