Comments (9)
The change is arleady merged into master, but not release yet. Is there any plan to release a new version soon?
from firebase-mock.
Hi @raman-nbg, any good PR to add support for mocking Firebase messaging in the admin SDK would be gladly accepted! Cheers.
from firebase-mock.
Ok, going to try this.
But one question about the implementation:
Messaging.send(message)
(https://firebase.google.com/docs/reference/admin/node/admin.messaging.Messaging.html#send) takes a message as an argument. Should I validate this message according to
https://firebase.google.com/docs/reference/admin/node/TokenMessage.html?
from firebase-mock.
Or should I implement it like described in erros.md?
from firebase-mock.
Anyone else interested in mocking admin FCM? @op? If so, I'd love to get your opinion.
Unless it makes a big difference in your workflow, @raman-nbg, I'd suggest preserving the pattern from errors.md
and not bother with validating the message.
Note that the message will be a Message instance and not necessarily a TokenMessage
!
from firebase-mock.
One more thing: we are migrating away from this repo in the near future; for now, if you could open your PR against https://github.com/dmurvihill/firebase-mock/, I will be publishing from there.
from firebase-mock.
Created PR: dmurvihill#43
from firebase-mock.
In the implementation you can see, that this is one is very simple. Messaging is stateless (send message, get result and forget about it) but the other components like firestore are stateful.
Messaging could also be mocked easily using sinon. But I think we should still add this feature. It's more convenient to have the same test behaviour for all firebase components.
from firebase-mock.
Ping!
from firebase-mock.
Related Issues (20)
- firebase.auth().createUser fails silently when it has `await` HOT 2
- Is this project still being maintained? HOT 3
- OMG - BREAKING ISSUE - Everything's messed up
- Add LICENSE file
- Type definition for type script
- How to check if firestore where function is called with params
- mockfirebase ref is not a function
- Add support for auth getUserByPhoneNumber and listUsers methods
- Issues with Jest
- `initializeApp` does not return `functions` method
- Firebase-mock's firestore() function does not return a singleton HOT 2
- Cannot be used in webpack/browser, due to require("fs") HOT 1
- Maintainer is deceased HOT 10
- Mock database sharding HOT 1
- Incorrect Bucket File download Api HOT 1
- npm install fails on macOS with node HOT 1
- Firebase Query equalTo does not support booleans
- Replace use of deprecated method sinon.reset() in tests
- onNext is not a function Jest
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firebase-mock.