(files: File[], sourceMaps: Map<string, any>)
| 379 | } |
| 380 | |
| 381 | async function updateTestFilesLocations(files: File[], sourceMaps: Map<string, any>) { |
| 382 | const promises = files.map(async (file) => { |
| 383 | const traceMap = await getTraceMap(file.filepath, sourceMaps) |
| 384 | if (!traceMap) { |
| 385 | return null |
| 386 | } |
| 387 | const updateLocation = (task: Task) => { |
| 388 | if (task.location) { |
| 389 | const position = getOriginalPosition(traceMap, task.location) |
| 390 | if (position) { |
| 391 | const { line, column } = position |
| 392 | task.location = { line, column: task.each ? column : column + 1 } |
| 393 | } |
| 394 | } |
| 395 | if ('tasks' in task) { |
| 396 | task.tasks.forEach(updateLocation) |
| 397 | } |
| 398 | } |
| 399 | file.tasks.forEach(updateLocation) |
| 400 | return null |
| 401 | }) |
| 402 | |
| 403 | await Promise.all(promises) |
| 404 | } |
| 405 | |
| 406 | function getTraceName(task: Task, retryCount: number, repeatsCount: number) { |
| 407 | const name = getTestName(task, '-').replace(/[^a-z0-9]/gi, '-') |
no test coverage detected