very_good_cli
very_good_cli copied to clipboard
fix: very_good test wrong behavior for Fonts
Description
There is a difference between flutter test and very_good test when testing the Google Fonts
Steps To Reproduce
- Create a test
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
test('Example test to verify GoogleFonts', () {
final textStyle = GoogleFonts.lato();
expect(textStyle.fontFamily, 'Lato_regular');
});
}
- Run
flutter test - No errors
00:01 +1: All tests passed!
- Run
very_good test - Error occurs
Error: google_fonts was unable to load font Lato-Regular because the following exception occurred:
Exception: Failed to load font with url: https://fonts.gstatic.com/s/a/5ced1045820caaac87af3f61ded09bacc90881f158d04c59dcce436fd02ad368.ttf
Expected Behavior
No errors with very_good test =)
Additional Context
Using the recommended init tests for fonts https://github.com/material-foundation/flutter-packages/blob/main/packages/google_fonts/example/test/unit_test.dart