FLUTTER ECOSYSTEM

firebase_auth_mocks

Fakes for Firebase Auth. Use this package with `google_sign_in_mocks` to write unit tests involving Firebase Authentication.

Latest version
0.15.2
30-day downloads
86.8K
Likes
104
Pub points
140

Package Overview

Selection guidance generated from public package information. For reference only.

Overview

A testing package that provides mock implementations for Firebase Authentication, enabling developers to simulate authentication flows without connecting to the actual Firebase backend. It works alongside `google_sign_in_mocks` to facilitate unit testing of authentication-related logic in Flutter apps. Ideal for testing login, sign-out, and user state changes in a controlled environment. The package supports all major platforms including Android, iOS, Web, macOS, and Windows, ensuring consistent test behavior across environments.

Use cases
  • Unit testing authentication flows
  • Simulating user sign-in and sign-out
  • Testing app behavior under different auth states
  • Validating UI updates based on user authentication
  • Developing offline test scenarios
Key features
  • Mock FirebaseAuth instance
  • Integration with google_sign_in_mocks
  • Platform-agnostic testing
  • Supports all Flutter platforms
  • Easy setup for test environments
Suitable for
  • Flutter developers writing tests
  • Teams practicing TDD or BDD
  • Apps relying heavily on Firebase Auth
  • Test-driven development workflows
  • CI/CD pipelines requiring reliable tests
Considerations
  • Not for production use
  • Requires companion google_sign_in_mocks
  • Mock behavior may not reflect real-world edge cases
  • Limited to basic auth state simulation
  • Does not support real-time auth listeners
Supported platformsAndroidiOSWebmacOSWindows

Install package

flutter pub add firebase_auth_mocks

Categories

Source repository

Related projects