MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / haveMultiple

Method haveMultiple

lib/helper/ApiDataFactory.js:310–316  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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]) {

Callers 1

Calls 2

haveMethod · 0.95
pushMethod · 0.80

Tested by

no test coverage detected