@@ -44,6 +44,7 @@ type TestResult struct {
4444 FailedProperty string
4545 Diff string
4646 Error error
47+ Skip bool
4748}
4849
4950// GetEventHandler create a new runtime.EventHandler
@@ -53,6 +54,12 @@ func (w *OutputWriter) GetEventHandler() *runtime.EventHandler {
5354 tr := convertTestResult (testResult )
5455 w .printResult (tr )
5556 }
57+
58+ handler .TestSkipped = func (testResult runtime.TestResult ) {
59+ tr := convertTestResult (testResult )
60+ w .printSkipped (tr )
61+ }
62+
5663 return & handler
5764}
5865
@@ -74,7 +81,7 @@ func (w *OutputWriter) PrintSummary(result runtime.Result) bool {
7481 return result .Failed == 0
7582}
7683
77- // PrintResult prints the simple output form of a TestReault
84+ // printResult prints the simple output form of a TestReault
7885func (w * OutputWriter ) printResult (r TestResult ) {
7986 if ! r .Success {
8087 w .fprintf (w .au .Red (w .template .testResult (r )))
@@ -83,6 +90,10 @@ func (w *OutputWriter) printResult(r TestResult) {
8390 w .fprintf (w .template .testResult (r ))
8491}
8592
93+ func (w * OutputWriter ) printSkipped (r TestResult ) {
94+ w .fprintf (fmt .Sprintf ("- [skipped] %s: was skipped" , r .Title ))
95+ }
96+
8697func (w * OutputWriter ) printFailures (results []runtime.TestResult ) {
8798 w .fprintf ("" )
8899 w .fprintf (w .au .Bold ("Results" ))
@@ -119,6 +130,7 @@ func convertTestResult(tr runtime.TestResult) TestResult {
119130 FailedProperty : tr .FailedProperty ,
120131 Diff : tr .ValidationResult .Diff ,
121132 Error : tr .TestCase .Result .Error ,
133+ Skip : tr .Skipped ,
122134 }
123135
124136 return testResult
0 commit comments