* Generates bunch of records and saves multiple API requests to store them. * * ```js * // create 3 posts * I.haveMultiple('post', 3); * * // create 3 posts by one author * I.haveMultiple('post', 3, { author: 'davert' }); * * // create 3 posts by one author with options
(factory, times, params, options)
| 308 | * @param {*} [options] |
| 309 | */ |
| 310 | haveMultiple(factory, times, params, options) { |
| 311 | const promises = [] |
| 312 | for (let i = 0; i < times; i++) { |
| 313 | promises.push(this.have(factory, params, options)) |
| 314 | } |
| 315 | return Promise.all(promises) |
| 316 | } |
| 317 | |
| 318 | async _createItem(model, data, options) { |
| 319 | if (!this.factories[model]) { |
no test coverage detected