Skip to content

Commit

Permalink
simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Oct 12, 2023
1 parent 4244a16 commit 5c06278
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,10 @@ function cypressSplit(on, config) {
const specRows = splitSpecs.map((absoluteSpecPath, k) => {
const relativeName = specAbsoluteToRelative[absoluteSpecPath]
const specRow = [String(k + 1), relativeName]
return specRow
})

specRows.forEach((specRow) => {
const specAbsolutePath = specRow[1]
const specResult = specResults[specAbsolutePath]
const specResult = specResults[absoluteSpecPath]
if (specResult) {
// shorted to relative filename
const relativeName = specAbsoluteToRelative[specAbsolutePath]
debug('spec results for %s', relativeName)
debug(specResult.stats)
// have to convert numbers to strings
Expand All @@ -157,8 +152,10 @@ function cypressSplit(on, config) {
specRow.push(String(specResult.stats.skipped))
specRow.push(humanizeDuration(specResult.stats.wallClockDuration))
} else {
console.error('Could not find spec results for %s', specAbsolutePath)
console.error('Could not find spec results for %s', absoluteSpecPath)
}

return specRow
})

return specRows
Expand Down

0 comments on commit 5c06278

Please sign in to comment.