Search packages, repositories and app categories

Package detailsv0.9.0

firebase_storage_mocks

Mocks for Firebase Storage. Use this package to write unit tests involving Firebase Storage.

AndroidiOSmacOSWindows
30-day downloads
30.5K
Likes
41
Pub points
140

Install package

flutter pub add firebase_storage_mocks

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A testing package that provides mock implementations for Firebase Storage, enabling developers to write reliable unit tests without requiring a real Firebase backend. It simulates storage operations like uploading, downloading, and deleting files, allowing test isolation and faster execution. Ideal for testing business logic that interacts with cloud storage. The package is compatible with multiple platforms and integrates seamlessly into Flutter projects.

Use cases

  • Unit testing Firebase Storage interactions
  • Testing file upload/download logic
  • Simulating network conditions in tests
  • Validating error handling in storage operations
  • Ensuring code reliability without live Firebase access

Key features

  • Complete mock implementation of Firebase Storage
  • Supports all common storage operations
  • Easy integration with test frameworks
  • Platform-agnostic for cross-platform testing
  • Minimal setup required for unit tests

Suitable for

  • Flutter developers writing unit tests
  • Teams prioritizing test coverage for cloud storage
  • Projects requiring fast, isolated tests
  • Developers avoiding real Firebase dependencies during testing
  • Test-driven development workflows

Considerations

  • Does not support real-time updates or streaming
  • Mock behavior may differ from actual Firebase
  • Not suitable for integration or end-to-end testing
  • Requires manual setup of expected responses
  • Limited to mocking, not full Firebase emulation

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Firebase Storage Mocks

Mocks for Firebase Storage. Use this package to write unit tests involving Firebase Storage.

pub package

Usage

A simple usage example: (assumes assets/someimage.png exists in project and is included in assets section of pubspec.yaml)

import 'package:firebase_storage_mocks/firebase_storage_mocks.dart';
import 'package:flutter/services.dart' show rootBundle;

main() async {
  final storage = MockFirebaseStorage();
  const filename = 'someimage.png';
  final storageRef = storage.ref().child(filename);
  final localImage = await rootBundle.load("assets/$filename");
  final task = await storageRef.putData(localImage.buffer.asUint8List());
  // Prints 'gs://some-bucket//someimage.png'.
  print(task.ref.fullPath);
}

Compatibility table

firebase_storage firebase_storage_mocks
13.0.0 0.8.0
12.0.0 0.7.0
11.0.0 0.6.0
10.0.0 0.5.1

Features and bugs

Please file feature requests and bugs at the issue tracker.

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package