Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: very_good test wrong behavior for Fonts #1220

Open
stact opened this issue Jan 3, 2025 · 0 comments
Open

fix: very_good test wrong behavior for Fonts #1220

stact opened this issue Jan 3, 2025 · 0 comments
Labels
bug Something isn't working as expected

Comments

@stact
Copy link

stact commented Jan 3, 2025

Description

There is a difference between flutter test and very_good test when testing the Google Fonts

Steps To Reproduce

  1. Create a test
void main() {
  TestWidgetsFlutterBinding.ensureInitialized();

  test('Example test to verify GoogleFonts', () {
    final textStyle = GoogleFonts.lato();
    expect(textStyle.fontFamily, 'Lato_regular');
  });
}
  1. Run flutter test
  2. No errors
00:01 +1: All tests passed!  
  1. Run very_good test
  2. 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

@stact stact added the bug Something isn't working as expected label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected
Projects
Status: Needs Triage
Development

No branches or pull requests

1 participant