I want to add tests to a Go project and have them fail when I run go test ./...
.
This is only for testing purposes. What is the minimum I need to add to my project to get failing tests?
I want to add tests to a Go project and have them fail when I run go test ./...
.
This is only for testing purposes. What is the minimum I need to add to my project to get failing tests?
Add this to a *_test.go
file, ie. fail_test.go
:
func TestWillFail(t *testing.T) {
t.Errorf("This test will fail.")
}