Generators
Sometimes you need a handy way to generate only fixtures from a single dataModel
. You can get a generator to do so.
var userDataModel = {
firstName: 'name.firstName',
lastName: 'name.lastName',
};
fixtureFactory.register('user', userDataModel);
var userGenerator = fixtureFactory.getGenerator('user');
and later on
var userFixture = userGenerator.generateOne();
var moreUserFixtures = userGenerator.generate(10);
var moreUserFixturesWithOpts = userGenerator.generate(10, {
email: 'internet.email'
});
Updated less than a minute ago