diff options
author | John Cai <jcai@gitlab.com> | 2019-02-13 19:47:39 +0300 |
---|---|---|
committer | John Cai <jcai@gitlab.com> | 2019-02-13 19:47:39 +0300 |
commit | 28a536bf1c85f62bb8f7f111ce0893748e81ed29 (patch) | |
tree | ac26a0924452fd5fb51a080f4834e7b2fb9bcacd | |
parent | 532be49f10424e7dd86837052382635c0140aaf9 (diff) | |
parent | b6382709e394b255a2a66e0e0aeb3b01ad09bc83 (diff) |
Merge branch 'zj-testing-docs' into 'master'
Explicitly favour testify over t.Testing functions
See merge request gitlab-org/gitaly!1070
-rw-r--r-- | doc/beginners_guide.md | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/beginners_guide.md b/doc/beginners_guide.md index 755dfaad4..3029bb454 100644 --- a/doc/beginners_guide.md +++ b/doc/beginners_guide.md @@ -294,6 +294,14 @@ Now you can run the one test you're interested in: go test -count 1 -run TestRepositoryExists ./internal/service/repository ``` +When writing tests, prefer using [testify]'s [require], and [assert] as +methods to set expectations over functions like `t.Fatal()` and others directly +called on `testing.T`. + +[testify]: https://github.com/stretchr/testify +[require]: https://github.com/stretchr/testify/tree/master/require +[assert]: https://github.com/stretchr/testify/tree/master/assert + #### Rspec tests It is possible to write end-to-end Rspec tests that run against a full |