()
| 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) |
no test coverage detected