Can't define Factory for user in imports/api/users/users.js


#1

I’m trying to define a factory for the Meteor.users collection using the dburles:factory package.
But I’m experiencing some very weird behavior.

If I put the code in imports/api/users/users.js I get:
Factory: There is no factory named user.

If I put the code in imports/api/someOtherCollection/someOtherCollection.js:
It works as expected.

I’ve investigated several possible issues but I think the only difference is that in imports/api/someOtherCollection/someOtherCollection.js I actually create a new collection using someOtherCollection = Meteor.Collection('someOtherCollection').

Any ideas why this is happening?

Update:

When I import the file where my factories are defined in one of my test-files everything works as expected.