mockfirebase icon indicating copy to clipboard operation
mockfirebase copied to clipboard

Support for Promises

Open olivierlesnicki opened this issue 8 years ago • 9 comments

https://www.firebase.com/blog/2016-01-21-keeping-our-promises.html

MockerFirebase API has now diverged from Firebase API (mainly due to the absence of Promises)

olivierlesnicki avatar Mar 21 '16 14:03 olivierlesnicki

I second that. That would be really helpful :+1: Will try to take a look at PR for this myself, but not sure on when I'll be able to share changes.

bricef avatar Apr 14 '16 12:04 bricef

anyone working on this? 😁 Happy to help contribute/test/qa but don't want to start from scratch if someone has already made progress

dylanjha avatar May 17 '16 22:05 dylanjha

@dylanjha don't think anyone has, go for it!

olivierlesnicki avatar May 18 '16 08:05 olivierlesnicki

I decided to go with https://github.com/urish/firebase-server instead which is working out nicely for me

dylanjha avatar Jun 16 '16 19:06 dylanjha

I don't like much the firebase.server as it needs to be executed in a separate process (unless I've missed something) so it's unusable in Travis and similar services.

Would be really great to catch up on latest API.

danielkcz avatar Jul 09 '16 18:07 danielkcz

I'm running firebase.server on circleci with no issues. In the same node process that starts the jasmine testrunning.

dylanjha avatar Jul 09 '16 19:07 dylanjha

I don't think the complication is about issues with another process, as much as it defies the methodology of unit tests. Idealy, you don't want to worry about external services until you reach integration/functional tests. Hence, while firebase-server has it's place, it doesn't belong in unit tests.

I agree that promise support is needed to keep the api in sync with Firebase.

mbrevda avatar Jul 27 '16 07:07 mbrevda

In case it's helpful, here's how I've hacked MockFirebase in my project to support promises: https://github.com/code-dot-org/code-dot-org/pull/9976/commits/cf4adbc185a91aa726c2e3df3b94a8162204ba5d

davidsbailey avatar Aug 12 '16 20:08 davidsbailey

I was able to get authentication promise support added for firebase sdk 3.x. See #112 for more info.

soumak77 avatar Sep 02 '16 02:09 soumak77