This may not look like much, but getting the image below to be generated by a Golden Image Test was a challenge!
I've managed to do all this by piecing out information from various StackOverflow and GitHub issues, without using any 3rd party packages. 💪
How does it work? 🧵
Believe it or not, all these steps need to be done programmatically:
- loading a custom font (Roboto)
- loading the material icons as a font
- precaching all image assets
That's because widget tests (which golden tests are based on) won't do any of this by default.
To learn more about golden testing, check my Flutter Foundations course, which already includes many in-depth lessons about automated testing! 👇
Found this useful? Show some love and share the original tweet 🙏
Previous | Next |
---|---|
Dart 2.17: Enhanced Enums with Members | How to Add a Custom Test Timeout in Flutter |