| 1 |
package reporters |
| 2 |
|
| 3 |
import ( |
| 4 |
"fmt" |
| 5 |
"path/filepath" |
| 6 |
|
| 7 |
"github.com/approvals/go-approval-tests/utils" |
| 8 |
) |
| 9 |
|
| 10 |
type quiet struct{} |
| 11 |
|
| 12 |
// NewQuietReporter creates a new reporter that does nothing. |
| 13 |
func NewQuietReporter() Reporter { |
| 14 |
return &quiet{} |
| 15 |
} |
| 16 |
|
| 17 |
func (s *quiet) Report(approved, received string) bool { |
| 18 |
approvedFull, _ := filepath.Abs(approved) |
| 19 |
receivedFull, _ := filepath.Abs(received) |
| 20 |
|
| 21 |
if utils.DoesFileExist(approved) { |
| 22 |
fmt.Printf("approval files did not match\napproved: %v\nreceived: %v\n", approvedFull, receivedFull) |
| 23 |
|
| 24 |
} else { |
| 25 |
fmt.Printf("result never approved\napproved: %v\nreceived: %v\n", approvedFull, receivedFull) |
| 26 |
} |
| 27 |
|
| 28 |
return true |
| 29 |
} |