diff --git a/apps/nx-update-ts-references/src/tests/integration/cli.spec.ts b/apps/nx-update-ts-references/src/tests/integration/cli.spec.ts index a0099eaf..5c23818d 100644 --- a/apps/nx-update-ts-references/src/tests/integration/cli.spec.ts +++ b/apps/nx-update-ts-references/src/tests/integration/cli.spec.ts @@ -34,20 +34,27 @@ suite('cli', () => { const result = await execAsync(`./bin.mjs --project-root ${projectRoot} --ci`); expect(result.stdout).to.contain(''); - // https://github.com/nrwl/nx/issues/29244 - expect(result.stderr).to.contain( - 'The inspector is disabled, coverage could not be collected' - ); - const stdErrWithoutWarning = result.stderr - .replace( - /\(node:\d+\) Warning: The inspector is disabled, coverage could not be collected\n/u, - '' - ) - .replace( - /\(Use `pnpm --trace-warnings ...` to show where the warning was created\)\n/u, - '' + // https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables + // eslint-disable-next-line n/no-process-env + if (process.env.GITHUB_ACTIONS === 'true') { + // Github Actions installs pnpm with a version of node that includes inspector. + expect(result.stderr).to.equal(''); + } else { + // https://github.com/nrwl/nx/issues/29244 + expect(result.stderr).to.contain( + 'The inspector is disabled, coverage could not be collected' ); - expect(stdErrWithoutWarning).to.equal(''); + const stdErrWithoutWarning = result.stderr + .replace( + /\(node:\d+\) Warning: The inspector is disabled, coverage could not be collected\n/u, + '' + ) + .replace( + /\(Use `pnpm --trace-warnings ...` to show where the warning was created\)\n/u, + '' + ); + expect(stdErrWithoutWarning).to.equal(''); + } }); test('unknown options', async () => {