File tree 2 files changed +20
-2
lines changed
2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -170,8 +170,7 @@ package class Parser {
170
170
171
171
package func formattedSummary( ) -> String ? {
172
172
guard let summary else { return nil }
173
- return nil
174
- // return renderer.format(testSummary: summary)
173
+ return summary. formatted ( renderer: renderer, colored: colored)
175
174
}
176
175
177
176
// MARK: Private
Original file line number Diff line number Diff line change
1
+ import Colorizer
2
+
1
3
struct TestSummary {
2
4
let testsCount : Int
3
5
let skippedCount : Int
@@ -19,6 +21,23 @@ struct TestSummary {
19
21
time: left. time + right. time
20
22
)
21
23
}
24
+
25
+ func formatted( renderer: Renderer , colored: Bool ) -> String {
26
+ switch renderer {
27
+ case . terminal:
28
+ if isSuccess ( ) {
29
+ return colored ? " Tests Passed: \( description) " . s. Bold. f. Green : " Tests Passed: \( description) "
30
+ } else {
31
+ return colored ? " Tests Failed: \( description) " . s. Bold. f. Red : " Tests Failed: \( description) "
32
+ }
33
+ case . gitHubActions:
34
+ if isSuccess ( ) {
35
+ return " ::notice::Tests Passed: \( description) "
36
+ } else {
37
+ return " ::error::Tests Failed: \( description) "
38
+ }
39
+ }
40
+ }
22
41
}
23
42
24
43
extension TestSummary {
You can’t perform that action at this time.
0 commit comments