File tree Expand file tree Collapse file tree 2 files changed +34
-4
lines changed Expand file tree Collapse file tree 2 files changed +34
-4
lines changed Original file line number Diff line number Diff line change @@ -52,17 +52,15 @@ export class TestResultsFormatter {
52
52
// some commands like `project deploy start` will report these failures as they happen via MSO:
53
53
// https://github.com/salesforcecli/plugin-deploy-retrieve/pull/1215
54
54
//
55
- // commands can set `skipVerboseTestReportOnCI` if so when instantiating the formatter to skip these (false by default).
55
+ // commands can enable/disable `skipVerboseTestReportOnCI` when instantiating the formatter to skip these
56
56
const skipVerboseTestReport = isCI ( ) && this . skipVerboseTestReportOnCI ;
57
57
58
58
if ( ! skipVerboseTestReport ) {
59
59
displayVerboseTestFailures ( this . result . response ) ;
60
60
}
61
61
62
62
if ( this . verbosity === 'verbose' ) {
63
- if ( ! skipVerboseTestReport ) {
64
- displayVerboseTestSuccesses ( this . result . response . details . runTestResult ?. successes ) ;
65
- }
63
+ displayVerboseTestSuccesses ( this . result . response . details . runTestResult ?. successes ) ;
66
64
displayVerboseTestCoverage ( this . result . response . details . runTestResult ?. codeCoverage ) ;
67
65
}
68
66
Original file line number Diff line number Diff line change @@ -72,4 +72,36 @@ describe('Deploy --verbose', () => {
72
72
expect ( shellOutput . stdout ) . to . contain ( 'Size: ' ) . and . contain ( 'KB of ~39 MB limit' ) ;
73
73
expect ( shellOutput . stdout ) . to . contain ( 'Files: 5 of 10,000 limit' ) ;
74
74
} ) ;
75
+
76
+ it ( 'should have test successes in the output' , ( ) => {
77
+ const shellOutput = execCmd < DeployResultJson > (
78
+ 'project deploy start --source-dir force-app --verbose --test-level RunLocalTests --dry-run' ,
79
+ {
80
+ ensureExitCode : 0 ,
81
+ }
82
+ ) . shellOutput ;
83
+
84
+ expect ( shellOutput . stdout ) . to . contain ( 'Test Success [1]' ) ;
85
+ } ) ;
86
+
87
+ it ( 'should have test successes in the output when CI=true' , ( ) => {
88
+ const ciEnvVar = process . env . CI ;
89
+ try {
90
+ process . env . CI = 'true' ;
91
+ const shellOutput = execCmd < DeployResultJson > (
92
+ 'project deploy start --source-dir force-app --verbose --test-level RunLocalTests --dry-run' ,
93
+ {
94
+ ensureExitCode : 0 ,
95
+ }
96
+ ) . shellOutput ;
97
+
98
+ expect ( shellOutput . stdout ) . to . contain ( 'Test Success [1]' ) ;
99
+ } finally {
100
+ if ( ciEnvVar === undefined ) {
101
+ delete process . env . CI ;
102
+ } else {
103
+ process . env . CI = ciEnvVar ;
104
+ }
105
+ }
106
+ } ) ;
75
107
} ) ;
You can’t perform that action at this time.
0 commit comments