katowulf / mockfirebase

Firebase mock library for writing unit tests (experimental)
157 stars 40 forks source link

Support for Promises #108

Open olivierlesnicki opened 8 years ago

olivierlesnicki commented 8 years ago

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)

bricef commented 8 years ago

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.

dylanjha commented 8 years ago

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

olivierlesnicki commented 8 years ago

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

dylanjha commented 8 years ago

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

danielkcz commented 8 years ago

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.

dylanjha commented 8 years ago

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

mbrevda commented 8 years ago

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.

davidsbailey commented 8 years ago

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

soumak77 commented 8 years ago

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