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

Method constructor

lib/workers.js:275–296  ·  view source on GitHub ↗

* @param {Number} numberOfWorkers * @param {Object} config

(numberOfWorkers, config = { by: 'test' })

Source from the content-addressed store, hash-verified

273 * @param {Object} config
274 */
275 constructor(numberOfWorkers, config = { by: 'test' }) {
276 super()
277 this.setMaxListeners(50)
278 this.codeceptPromise = initializeCodecept(config.testConfig, config.options)
279 this.codecept = null
280 this.config = config // Save config
281 this.numberOfWorkersRequested = numberOfWorkers // Save requested worker count
282 this.options = config.options || {}
283 this.errors = []
284 this.numberOfWorkers = 0
285 this.closedWorkers = 0
286 this.workers = []
287 this.testGroups = []
288 this.testPool = []
289 this.testPoolInitialized = false
290 this.isPoolMode = config.by === 'pool'
291 this.activeWorkers = new Map()
292 this.maxWorkers = numberOfWorkers // Track original worker count for pool mode
293
294 createOutputDir(config.testConfig)
295 // Defer worker initialization until codecept is ready
296 }
297
298 async _ensureInitialized() {
299 if (!this.codecept) {

Callers

nothing calls this directly

Calls 2

initializeCodeceptFunction · 0.85
createOutputDirFunction · 0.70

Tested by

no test coverage detected