Skip to content

gustavohenke/mockbase

Folders and files

NameName
Last commit message
Last commit date
Jun 24, 2020
Jun 17, 2020
Sep 27, 2020
Sep 27, 2020
May 24, 2020
Dec 26, 2017
Jan 8, 2018
Jul 7, 2018
Jun 17, 2020
Jun 20, 2020
Jun 24, 2020
Dec 2, 2022
Sep 27, 2020
Jun 17, 2020

Repository files navigation

Mockbase

Build status Coverage

Firebase v7+ mock. Great for unit testing and Storybooks. Built-in support for TypeScript included.

However, please note that not all features are implemented. Take a look at the implemented features table to find out what is available and what is not.

How to use

Wherever you would use Firebase's app or its features, you pass a Mockbase app or feature instance:

const firebase = require("firebase");
function signInWithFacebook(firebaseAuth: firebase.auth.Auth) {
  firebaseAuth.signInWithPopup(new firebase.auth.FacebookAuthProvider());
}

function addTodo(text: string, todoCollection: firebase.firestore.CollectionReference) {
  return todoCollection.add({ text });
}

const MockApp = require("mockbase");
const app = new MockApp("app name");
signInWithFacebook(app.auth());
addTodo("Clean home up", app.firestore().collection("todo"));

Implemented features

Feature group Status
Analytics ❌ Not implemented
Auth ⚠️ Partly implemented
Database ❌ Not implemented
Firestore ✅ Implemented*
Functions ❌ Not implemented
Installations ❌ Not implemented
Messaging ❌ Not implemented
Performance ❌ Not implemented
Remote config ❌ Not implemented
Storage ❌ Not implemented

* There's no difference between server and cache, thus there won't be pending writes.