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

Method _ensureInitialized

lib/workers.js:298–310  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

296 }
297
298 async _ensureInitialized() {
299 if (!this.codecept) {
300 this.codecept = await this.codeceptPromise
301 // Initialize workers in these cases:
302 // 1. Positive number requested AND no manual workers pre-spawned
303 // 2. Function-based grouping (indicated by negative number) AND no manual workers pre-spawned
304 const shouldAutoInit = this.workers.length === 0 && ((Number.isInteger(this.numberOfWorkersRequested) && this.numberOfWorkersRequested > 0) || (this.numberOfWorkersRequested < 0 && isFunction(this.config.by)))
305
306 if (shouldAutoInit) {
307 this._initWorkers(this.numberOfWorkersRequested, this.config)
308 }
309 }
310 }
311
312 _initWorkers(numberOfWorkers, config) {
313 this.splitTestsByGroups(numberOfWorkers, config)

Callers 4

bootstrapAllMethod · 0.95
teardownAllMethod · 0.95
runMethod · 0.95
worker_test.jsFile · 0.80

Calls 2

_initWorkersMethod · 0.95
isFunctionFunction · 0.90

Tested by

no test coverage detected