Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gustavohenke/mockbase
Firebase v7+ mock.
https://github.com/gustavohenke/mockbase
firebase mock typescript
Last synced: about 2 months ago
JSON representation
Firebase v7+ mock.
- Host: GitHub
- URL: https://github.com/gustavohenke/mockbase
- Owner: gustavohenke
- Created: 2016-09-04T05:33:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T01:33:05.000Z (almost 2 years ago)
- Last Synced: 2024-10-06T16:41:01.914Z (3 months ago)
- Topics: firebase, mock, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/mockbase
- Size: 844 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mockbase
[![Build status](https://img.shields.io/travis/gustavohenke/mockbase.svg?style=flat-square)](https://travis-ci.org/gustavohenke/mockbase)
[![Coverage](https://img.shields.io/coveralls/github/gustavohenke/mockbase.svg?style=flat-square)](https://coveralls.io/github/gustavohenke/mockbase)Firebase v7+ mock. Great for unit testing and [Storybooks](https://storybook.js.org).
Built-in support for TypeScript included.However, please note that not all features are implemented.
Take a look at the [implemented features table](#implemented-features) 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:
```ts
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.