firebase_storage_mocks
0.9.0, released 2 weeks ago by wafrat.com
Mocks for Firebase Storage to write unit tests.
What it does
Provides mock implementations for Firebase Storage, allowing developers to write unit tests that involve Firebase Storage without connecting to a real backend. It supports functionalities like putting data, getting download URLs, listing files, and updating metadata.
AI-written summary of version 0.9.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are writing unit tests for code that uses Firebase Storage
- You need to test file upload, download, or deletion logic without a live Firebase connection
Skip it when
- You are performing integration or end-to-end testing with a real backend
- Your project does not use Firebase Storage
Strengths
- Enables unit testing for Firebase Storage features
- Maintains compatibility with official firebase_storage package versions
- Implements many core features including putData, getDownloadURL, and listAll
Weaknesses
- Mock behavior may not cover 100% of edge cases present in the real Firebase Storage backend
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
import 'package:firebase_storage_mocks/firebase_storage_mocks.dart';
main() async {
final storage = MockFirebaseStorage();
const filename = 'someimage.png';
final storageRef = storage.ref().child(filename);
// Use storageRef in tests
}Alternatives
Packages that do the same job and could replace firebase_storage_mocks.
- google_sign_in_mocks
Mocks for Google Sign In to write unit tests for authentication.
73Compare - firebase_database_mocks
Mock library to write unit tests for Firebase Realtime Database.
77Compare - fake_cloud_firestore
Fake implementation of Cloud Firestore for unit testing.
87Compare - mocktail
Dart mock library with null safety support and no manual mocks or code generation.
84Compare
Works with
Packages commonly used together with firebase_storage_mocks: ones it builds on, ones built on it, and its own family.