Overview
A testing package that provides mock implementations for Google Sign In, enabling developers to simulate authentication flows without requiring actual Google accounts. It integrates seamlessly with firebase_auth_mocks, making it ideal for writing reliable unit tests for Firebase Authentication logic in Flutter apps. The mocks support all major platforms including Android, iOS, Web, and macOS, ensuring consistent test behavior across environments.
Use cases
- Unit testing Firebase Auth with Google Sign In
- Simulating login/logout flows in tests
- Testing app behavior after Google Sign In
- Validating state changes triggered by authentication
- Ensuring platform-agnostic test reliability
Key features
- Mock GoogleSignIn class with configurable responses
- Integration with firebase_auth_mocks
- Supports all major platforms
- Easy setup for test environments
- No external dependencies during testing
Suitable for
- Flutter developers writing unit tests
- Teams using Firebase Authentication
- Test-driven development workflows
- Cross-platform app testing
- CI/CD pipelines requiring stable test runs
Considerations
- Not for production use
- Requires firebase_auth_mocks for full functionality
- Mock behavior must be explicitly defined in tests
- Limited to sign-in simulation, not full OAuth flow
- Does not handle real Google account interactions