soumak77 / firebase-mock

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

fix: add boolean as acceptable query priority type #167

Closed Redmega closed 4 years ago

Redmega commented 4 years ago

Resolves #166

dmurvihill commented 4 years ago

Thanks @Redmega. We're migrating away from this repo, but I opened and merged companion PR on my fork, which we are using to publish. Look for this in 3.0.0 and 2.3.1.

Redmega commented 4 years ago

You might want to hold off on that @dmurvihill

I added a proper test and it's not giving the expected result. I need to look into why.

Redmega commented 4 years ago

Do you want me to open a PR to that fork and move discussion there?

dmurvihill commented 4 years ago

Yes, go ahead and reopen over there if you don't mind.

I've been looking into this; I think the priorityComparator method (utils.js:64) is incomplete. It seems to be interested only in priorities of type null, string, and number, ignoring boolean and object values in spite of the Firebase docs.

There may (not sure) also be a problem with Slice.prototype._inRange (slice.js:85) which might be doing an exclusive rather than an inclusive range.