Giter Site home page Giter Site logo

Comments (9)

raman-nbg avatar raman-nbg commented on June 10, 2024 1

The change is arleady merged into master, but not release yet. Is there any plan to release a new version soon?

from firebase-mock.

dmurvihill avatar dmurvihill commented on June 10, 2024

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.

raman-nbg avatar raman-nbg commented on June 10, 2024

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.

raman-nbg avatar raman-nbg commented on June 10, 2024

Or should I implement it like described in erros.md?

from firebase-mock.

dmurvihill avatar dmurvihill commented on June 10, 2024

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.

dmurvihill avatar dmurvihill commented on June 10, 2024

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.

raman-nbg avatar raman-nbg commented on June 10, 2024

Created PR: dmurvihill#43

from firebase-mock.

raman-nbg avatar raman-nbg commented on June 10, 2024

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.

mull avatar mull commented on June 10, 2024

Ping!

from firebase-mock.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.