Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soumak77/firebase-mock
Firebase mock library for writing unit tests
https://github.com/soumak77/firebase-mock
firebase firebase-admin firebase-auth firebase-database firebase-firestore firebase-functions firebase-storage mock mocking mocking-library mocks testing unit-testing
Last synced: 4 days ago
JSON representation
Firebase mock library for writing unit tests
- Host: GitHub
- URL: https://github.com/soumak77/firebase-mock
- Owner: soumak77
- Created: 2016-10-26T04:54:54.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-06T17:00:18.000Z (about 2 years ago)
- Last Synced: 2024-10-29T22:56:37.947Z (3 months ago)
- Topics: firebase, firebase-admin, firebase-auth, firebase-database, firebase-firestore, firebase-functions, firebase-storage, mock, mocking, mocking-library, mocks, testing, unit-testing
- Language: JavaScript
- Homepage: https://soumak77.github.io/firebase-mock
- Size: 2.92 MB
- Stars: 350
- Watchers: 8
- Forks: 96
- Open Issues: 62
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
Firebase Mock [![Build Status](https://travis-ci.org/soumak77/firebase-mock.svg?branch=master)](https://travis-ci.org/soumak77/firebase-mock)
============Firebase Mock extends [mockfirebase](https://github.com/katowulf/mockfirebase) to provide support for the following Firebase Javascript SDKS:
- [firebase](https://github.com/firebase/firebase-js-sdk)
- [firebase-admin](https://github.com/firebase/firebase-admin-node)
- [firebase-functions](https://github.com/firebase/firebase-functions)## Setup
```bash
npm install firebase-mock --save-dev
```
Follow the steps in the [Setup Tutorial](tutorials/integration/setup.md) to create a mock SDK to be used in your tests. Then follow one of the tutorials below based on your testing framework:
* [Proxyquire](tutorials/integration/proxyquire.md)
* [Jest](tutorials/integration/jest.md)
* [Window Override](tutorials/integration/window.md)## API
Firebase Mock supports the client-side [JavaScript API](https://firebase.google.com/docs/reference/js/) and server-side [Admin API](https://firebase.google.com/docs/reference/admin/node/) plus a small set of utility methods documented fully in the [API Reference](API.md). Rather than make a server call that is actually asynchronous, Firebase Mock allows you to either trigger callbacks synchronously or asynchronously with a specified delay ([`ref.flush`](API.md#flushdelay---ref)).
## Tutorials
### Client ([firebase](https://github.com/firebase/firebase-js-sdk))
* Authentication
* [Basic](tutorials/client/auth/authentication.md)
* [JWT Tokens](tutorials/client/auth/tokens.md)
* Realtime Database
* [Basic](tutorials/client/rtdb/basic.md)
* [Simulating Errors](tutorials/client/rtdb/errors.md)
* [Ordering](tutorials/client/rtdb/spies.md)
* [Firestore](tutorials/client/firestore.md)
* [Storage](tutorials/client/storage.md)### Admin ([firebase-admin](https://github.com/firebase/firebase-admin-node))
* Authentication
* [Basic](tutorials/admin/authentication.md)
* [JWT Tokens](tutorials/admin/tokens.md)
* [Realtime Database](tutorials/admin/rtdb.md)
* [Firestore](tutorials/admin/firestore.md)
* [Storage](tutorials/admin/storage.md)### Functions ([firebase-functions](https://github.com/firebase/firebase-functions))
* [Realtime Database](tutorials/functions/rtdb.md)
* [Firestore](tutorials/functions/firestore.md)
* [HTTP](tutorials/functions/http.md)## Alternatives
* [firebase-server](https://github.com/urish/firebase-server)
* [firebase-functions-test](https://firebase.google.com/docs/functions/unit-testing)