soumak77 / firebase-mock

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

Add all where operators to the query (==, !=, >, >=, <, <=) #154

Open jrmd opened 5 years ago

jrmd commented 5 years ago

This is very similar to #116 however this doesn't make use of eval which is a security issue.

dmurvihill commented 4 years ago

Thanks for the contribution! This repo is no longer usable. Can you re-open here?

Also, can you fix the broken unit test and add coverage for the new operators? We're shooting for a release soon after December 1 so if you have time to submit a PR before next Thursday that will give us the best chance of including this change.

jrmd commented 4 years ago

@dmurvihill I will certainly try find the time! currently i have my own forked version published but it would be good to get a common fork

dmurvihill commented 4 years ago

Cheers. We're also looking for co-maintainers.

alexpchin commented 4 years ago

@dmurvihill was this PR opened on https://github.com/dmurvihill/firebase-mock ? I can't see that it was?

dmurvihill commented 4 years ago

Hi @alexpchin, thanks for asking! This pull request lacks test coverage and as a result it incorrectly handles comparisons between types (see How query data is ordered). I've added a branch dmurvihill:feature/add-all-where-operators that merges with master and adds stub unit tests; if you can carry it the rest of the way and open a PR to my fork I would be grateful.

dmurvihill commented 4 years ago

Try the priorityComparator function in utils.js; I think it's close to correct.