Can't use on the client side?
sungwoncho opened this issue · comments
I haven't tested this, but the code seems like it won't work on the client side because of this line. Meteor won't let an untrusted code use an arbitrary Mongo selector with collection.remove
.
This might be a problem when doing client integration tests.
If that's the case, how about implementing something like this PR by @riebeekn?
sungwoncho/factory-boy#3
The function is only intended to run on the server. You would define a Meteor method that calls the resetDatabase function. Then you can call the Meteor method from the client side.
We could define a Meteor method for this in this package.
I haven't read the README thoroughly enough:
You can do this inside a Meteor method and call it from your client tests.
I think defining a method in the package sounds like a good idea. Will submit a PR.
Fixed by #10