Fake Firebase Performance for use during Flutter unit & widget tests.

Overview

Fake Firebase Performance

pub package

Fakes to write unit tests for apps using Firebase Performance monitoring. Instantiate a FakeFirebasePerformance, then pass it around your project to replace FirebasePerformance.instance. This fake acts like FirebasePerformance except it will load mocked data instead.

Usage

A simple usage example

import 'package:fake_firebase_performance/fake_firebase_performance.dart';

void main() async {
  final perf = FakeFirebasePerformance();

  perf.isPerformanceCollectionEnabled(); // will return false

  perf.newTrace('test'); // will do nothing
  perf.newHttpMetric("https://example.com/", HttpMethod.Get); // will do nothing
}

This perf object needs to replace the real FirebasePerformance.instance during testing. You can do this for example with Riverpod or by doing something like this:

await tester.pumpWidget(
  MaterialApp(
    title: 'FirebasePerformance Example',
    home: MyApp(overrideFirebasePerformance: perf),
  ),
);

Missing functionality

  • perf.app will throw
  • perf.pluginConstants is empty
  • perf.newTrace() does nothing
  • perf.newHttpMetric() does nothing

Compatibility table

firebase_performance fake_firebase_performance
>=0.8.0 1.0.0

Features and bugs

Please file feature requests and bugs at the issue tracker.

You might also like...

A Flutter app developed during classroom lessons in the Mobile & Gaming 2021/2023 course

quiz A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this is

Oct 11, 2022

This is a simple mobile application which calculates the person expenses during each week and tracks up where he spend his money!

This is a simple mobile application which calculates the person expenses during each week and tracks up where he spend his money!

Presonal Expenses Tracker Table of content About the project built with Getting Started installation Running ScreenShots About This is a simple mobile

Nov 3, 2022

Let's setup Firebase​​ for our Flutter​​ app on Android​, iOS​ and Flutter Web. Setup Firebase to use Firebase products.

Let's setup Firebase​​ for our Flutter​​ app on Android​, iOS​ and Flutter Web.  Setup Firebase to use Firebase products.

Flutter Tutorial - Firebase Setup For Flutter Web Let's setup Firebase for our Flutter app on Android, iOS and Flutter Web. Setup Firebase to use Fire

Apr 27, 2022

Quizlet-Flutter - A quiz app tests the analyzing Information on Financial Statements (True or False)

Quizlet-Flutter - A quiz app tests the analyzing Information on Financial Statements (True or False)

Quizlet-Flutter This is a simple Quizlet mobile application testing your financi

Jan 19, 2022

Integration Test Preview allows tests on multiple screen sizes in a single e2e test run.

Integration Test Preview allows tests on multiple screen sizes in a single e2e test run.

Integration Test Preview has pre-configured methods that allow for faster test deployment for end to end (e2e) test coverage (using Android and iOS pl

Aug 23, 2022

Write and debug tests easily, built on integration_test

Write and debug tests easily, built on integration_test

flutter_convenient_test: Write and debug tests easily, built on integration_test Quick demo full_video.mov Have questions? Though used in production e

Dec 21, 2022

A better font for golden tests.

A better font for golden tests.

A better font for golden tests. This project is a Flutter Bounty Hunters proof-of-concept. Want font adjustments? Fund a milestone today! Golden Brick

Dec 14, 2022

Chance Dart is a free Open Source project that lets you create random strings, integers, and other things to help with tiresome tasks, especially when building automated tests or wherever else you require anything random.

 Chance Dart is a free Open Source project that lets you create random strings, integers, and other things to help with tiresome tasks, especially when building automated tests or wherever else you require anything random.

Chance Dart Random generator helper for Dart Homepage • Documentation Overview Chance Dart is a free Open Source project that lets you create random s

Dec 27, 2022

Performance overlay for Flutter apps that works on web.

performance Performance overlay for Flutter apps that works on web. Repo structure This repo currently contains the following packages: Package Conten

Dec 3, 2022
Ozzie is your testing friend. Ozzie will take an screenshot during integration tests whenever you need. Ozzie will capture performance reports for you.

ozzie.flutter Ozzie is your testing friend. Ozzie will take an screenshot during integration tests whenever you need. Ozzie will capture performance r

Jorge Coca 40 Nov 3, 2022
🌈 Repository for a compass project, basically an App for displaying bank transfers, with API requests, Flag persistence, Infinite Scroll, Error Handling, Unit Tests, Extract Sharing working with SOLID, BLoC and Designer Patterns.

?? Green Bank Aplicação desenvolvida em Flutter com intuito de trabalhar conexão com API, Gerenciamento de estado usando BLoC, Refatoração, Arquitetur

André Guerra Santos 28 Oct 7, 2022
End-to-end mobile app templates that other developers can use during their Flutter development journey.

Flutter UI Templates Welcome Contributors ?? The Robotics Forum always encourages new ideas. Aim ?? Main aim of this repository is to make things fast

The Robotics Forum, VIT Pune 8 Dec 18, 2022
Create fake phone contacts, to do data-poisoning.

Fake Contacts Android phone app that creates fake contacts, which will be stored on your smartphone along with your real contacts. This feeds fake dat

Bill Dietrich 531 Dec 23, 2022
Charlatan - A library for configuring and providing fake http responses to your dio HTTP client.

charlatan This package provides the ability to configure and return fake HTTP responses from your Dio HTTP Client. This makes it easy to test the beha

Betterment 14 Nov 28, 2022
A composable, light-weight package that can be used as a placeholder whenever you need some fake data

API Placeholder A composable, light-weight package that can be used as a placeholder whenever you need some fake data. With this package, you can get

ASMIT VIMAL 2 Feb 27, 2022
Flutter widget to change `themeMode` during runtime and persist it across restarts.

theme_mode_handler Flutter widget to change themeMode during runtime and persist it across restarts. Motivation Flutter 1.9 introduced a new way to co

Arthur Denner 28 Oct 29, 2022
A Simple but elegant Calculator app made with Flutter using Google's Material Design with Currency (Exchange Rate) and Unit Converter.

Calculator A Simple but elegant Calculator app made with Flutter using Google's Material Design with Currency (Exchange Rate) and Unit Converter. Down

Hemant Rajput 15 Dec 7, 2022
The app that i built during the IITM Session on "Working with APIs in Flutter"

api_test A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this

Aswin Gopinathan 1 Dec 18, 2021
Production-grade project developed during the Reso Coder Academy Flutter Bootcamp: It's a mobile Github repository viewer

RepoStar - GitHub Starred Repository Manager Production-grade project developed during the Reso Coder Academy Flutter Bootcamp. It's a mobile Github s

Kishan Dhankecha 4 Aug 18, 2022