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