I'm Alexander Egurnov, Senior Software Engineer at PubNative. I've been coding in Go since March 2016.
This is an introduction and a live demo of my favorite features of Ginkgo testing framework and it's accompanying assertion library Gomega.
- Gomega
- Standalone
Expect
andΩ
notations- Annotations
- Matchers
- Error checking
- Panic
- Equivalence
- Numbers
- Other types
- Collections
- Async assertions
- Combining matchers
- Transformations
- Custom matchers
- Ginkgo
- Connecting to testing package
- Connecting Gomega
- Context/Describe/When, It/Specify, By
- Focus, Skip, Pending
- Setup and teardown
- Async functions
- Measurements
- CLI
ginkgo bootstrap
andginkgo generate
go test
interoperabilityGinkgoWriter
and-v
optionginkgo -p
ginkgo -r
-skipMeasurements
-flakeAttempts=ATTEMPTS
-untilItFails
ginkgo watch -notify -r -skipMeasurements
ginkgo blur/unfocus
- General advice
- Keep tests readable