| 55 | } |
| 56 | |
| 57 | constructor( |
| 58 | private _config: WebdriverIO.Config, |
| 59 | public totalWorkerCnt: number, |
| 60 | private _isWatchMode = false |
| 61 | ) { |
| 62 | super() |
| 63 | |
| 64 | /** |
| 65 | * Colors can be forcibly enabled/disabled with env variable `FORCE_COLOR` |
| 66 | * `FORCE_COLOR=1` - forcibly enable colors |
| 67 | * `FORCE_COLOR=0` - forcibly disable colors |
| 68 | */ |
| 69 | this.hasAnsiSupport = supportsColor && supportsColor.hasBasic |
| 70 | |
| 71 | this.totalWorkerCnt = totalWorkerCnt |
| 72 | this._isWatchMode = _isWatchMode |
| 73 | this._specFileRetries = _config.specFileRetries || 0 |
| 74 | this._specFileRetriesDelay = _config.specFileRetriesDelay || 0 |
| 75 | |
| 76 | this.on('job:start', this.addJob.bind(this)) |
| 77 | this.on('job:end', this.clearJob.bind(this)) |
| 78 | |
| 79 | this.setup() |
| 80 | this.onStart() |
| 81 | } |
| 82 | |
| 83 | #hasShard() { |
| 84 | return this._config.shard && this._config.shard.total !== 1 |