soumak77 / firebase-mock

Firebase mock library for writing unit tests
https://soumak77.github.io/firebase-mock
350 stars 96 forks source link

Snapshot .val() should return a new clone each time #65

Closed esprehn closed 6 years ago

esprehn commented 6 years ago

https://github.com/soumak77/firebase-mock/blob/1c348c14b812a20a15ae388352413f12bac63790/src/snapshot.js#L13

The API is supposed to return a new deeply cloned object each time. All the existing callers in that file need to use some internal API probably like ._value() since ex. exists() shouldn't clone the whole value just to check if it's null.