Márk Sági-Kazár
2021-10-11 @ Golang Szeged
files ending with _test.go
functions starting with Test[A-Z]
func(t *testing.T)
signature
t.Log()
t.Error()
t.Fatal()
t.Skip()
Tests are executed concurrently by default. Packages are tested in parallel by default.
Testify: https://github.com/stretchr/testify
Testify: github.com/stretchr/testify/mock
Generator: https://github.com/vektra/mockery
Testify: github.com/stretchr/testify/suite
https://peter.bourgon.org/blog/2021/04/02/dont-use-build-tags-for-integration-tests.html
Take them with a grain of salt.
testing/fstest
MapFS
TB.Setenv
Must not be used in parallel tests (ie. with t.Parallel
).
Questions?