()
| 206 | } |
| 207 | |
| 208 | protected async loadInstalledBinaries(): Promise<void> { |
| 209 | const pwVersions = this.config.getPwVersions(); |
| 210 | const browserTypes = ['chromium', 'firefox', 'webkit'] as const; |
| 211 | |
| 212 | await Promise.all( |
| 213 | browserTypes.map(async (browserType) => { |
| 214 | const installed: Array<[number, string, string]> = []; |
| 215 | |
| 216 | await Promise.all( |
| 217 | Object.keys(pwVersions).map(async (version) => { |
| 218 | const minor = parseFloat(version); |
| 219 | if (isNaN(minor)) return; |
| 220 | |
| 221 | try { |
| 222 | const pw = await this.config.loadPwVersion(version); |
| 223 | const exePath = pw[browserType].executablePath(); |
| 224 | if (await exists(exePath)) { |
| 225 | installed.push([minor, version, exePath]); |
| 226 | } |
| 227 | } catch { |
| 228 | // Package not installed, skip |
| 229 | } |
| 230 | }), |
| 231 | ); |
| 232 | |
| 233 | installed.sort(([a], [b]) => a - b); |
| 234 | this.config.setInstalledBinaries(browserType, installed); |
| 235 | }), |
| 236 | ); |
| 237 | } |
| 238 | |
| 239 | protected async saveMetrics(): Promise<void> { |
| 240 | const metricsPath = this.config.getMetricsJSONPath(); |
no test coverage detected