Hi!
I’ve been following the guide on creating test data at https://guide.meteor.com/testing.html#generating-test-data .
I’ve read through the documentation of Factory at https://atmospherejs.com/dburles/factory and am still a little confused as to what it does.
I’m reading the ‘define’ method as being sort of like a constructor for test Documents that belong to some Collection.
I see that you can then instantiate a Document from this definition by using the Create method. Documentation states that create method inserts that document into MongoDB. What DB is this, a test one ? I don’t think it’s the actual app’s one because I ran a count() on my collection before and after running the test and it did not change.
The Factory.build function is supposed to be like Create, except that it does not insert into the DB. This would be fine, except I see that the resulting object does not have access to helper methods.
Documentation for StubCollections seemed to be more intuitive. It simply creates a LocalCollection. What’s the general consensus to use for creating test data? Thanks!