npm

Need private packages and team management tools?Check out npm Orgs. »

mockbase

0.4.2 • Public • Published

Mockbase

Build status Coverage

Firebase v6+ 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
Auth Partly implemented
Database Not implemented
Firestore Partly implemented
Messaging Not implemented
Storage Not implemented

Keywords

none

install

npm i mockbase

Downloadsweekly downloads

22

version

0.4.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability