diff --git a/src/formatters/testResultsFormatter.ts b/src/formatters/testResultsFormatter.ts index 0a2c68937..719095f13 100644 --- a/src/formatters/testResultsFormatter.ts +++ b/src/formatters/testResultsFormatter.ts @@ -52,7 +52,7 @@ export class TestResultsFormatter { // some commands like `project deploy start` will report these failures as they happen via MSO: // https://github.com/salesforcecli/plugin-deploy-retrieve/pull/1215 // - // commands can set `skipVerboseTestReportOnCI` if so when instantiating the formatter to skip these (false by default). + // commands can enable/disable `skipVerboseTestReportOnCI` when instantiating the formatter to skip these const skipVerboseTestReport = isCI() && this.skipVerboseTestReportOnCI; if (!skipVerboseTestReport) { @@ -60,9 +60,7 @@ export class TestResultsFormatter { } if (this.verbosity === 'verbose') { - if (!skipVerboseTestReport) { - displayVerboseTestSuccesses(this.result.response.details.runTestResult?.successes); - } + displayVerboseTestSuccesses(this.result.response.details.runTestResult?.successes); displayVerboseTestCoverage(this.result.response.details.runTestResult?.codeCoverage); } diff --git a/test/nuts/deploy/verbose.nut.ts b/test/nuts/deploy/verbose.nut.ts index a650a36ce..907c75daf 100644 --- a/test/nuts/deploy/verbose.nut.ts +++ b/test/nuts/deploy/verbose.nut.ts @@ -72,4 +72,36 @@ describe('Deploy --verbose', () => { expect(shellOutput.stdout).to.contain('Size: ').and.contain('KB of ~39 MB limit'); expect(shellOutput.stdout).to.contain('Files: 5 of 10,000 limit'); }); + + it('should have test successes in the output', () => { + const shellOutput = execCmd( + 'project deploy start --source-dir force-app --verbose --test-level RunLocalTests --dry-run', + { + ensureExitCode: 0, + } + ).shellOutput; + + expect(shellOutput.stdout).to.contain('Test Success [1]'); + }); + + it('should have test successes in the output when CI=true', () => { + const ciEnvVar = process.env.CI; + try { + process.env.CI = 'true'; + const shellOutput = execCmd( + 'project deploy start --source-dir force-app --verbose --test-level RunLocalTests --dry-run', + { + ensureExitCode: 0, + } + ).shellOutput; + + expect(shellOutput.stdout).to.contain('Test Success [1]'); + } finally { + if (ciEnvVar === undefined) { + delete process.env.CI; + } else { + process.env.CI = ciEnvVar; + } + } + }); });