Writing Better Tests with Suites (Episode 20)
ฝัง
- เผยแพร่เมื่อ 5 ก.พ. 2025
- Learn more with the Ultimate Guide to Web Apps in Go: bit.ly/webapps-go
You don't always have to just use the standard library test package to test your code! We look into how to improve your tests with testify/suite (godoc.org/gith...) in this screencast.
Keep on rockin, Gophers!
Awesome video, Ive been using testify forever but never utilized suites, great demo
I'm using testify in almost every project I write tests for. Somehow I haven't heard about Suite so far.
I guess it makes sense for more integration test style tests rather than unit tests.
Thanks for sharing.
Any time Matthias :)
I've been moving away from testify in my projects as it doesn't work well with vim-go, and I feel like it's a barrier for new contributors. I was able to implement a test suite in ~20 lines of code using the familiar test-table pattern: github.com/jhillyerd/inbucket/blob/develop/pkg/test/storage_suite.go
Hey James - I'd love to hear what issues it has with vim-go. I can get in contact with the creator of the plugin if appropriate. Also, your table-based suite looks very nice! I wonder if you'd like to make that into its own package?