Skip to content

Commit

Permalink
fix: get absolute spec paths from Cypress before v10, closes #140
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Oct 18, 2023
1 parent a9125bd commit d6db0d0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"arg": "^5.0.2",
"console.table": "^0.10.0",
"debug": "^4.3.4",
"find-cypress-specs": "1.36.3",
"find-cypress-specs": "1.36.4",
"globby": "^11.1.0",
"humanize-duration": "^3.28.0"
},
Expand Down
11 changes: 7 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,19 @@ function cypressSplit(on, config) {
debug('after:spec for %s %o', spec.relative, results.stats)
}

const cwd = process.cwd()
const absoluteSpecPath = spec.absolute || path.join(cwd, spec.relative)

// make sure there are no duplicate specs for some reason
if (specResults[spec.absolute]) {
if (specResults[absoluteSpecPath]) {
console.error(
'Warning: cypress-split found duplicate test results for %s',
spec.absolute,
absoluteSpecPath,
)
}

specResults[spec.absolute] = results
specAbsoluteToRelative[spec.absolute] = spec.relative
specResults[absoluteSpecPath] = results
specAbsoluteToRelative[absoluteSpecPath] = spec.relative
})

let SPLIT = process.env.SPLIT || config.env.split || config.env.SPLIT
Expand Down

0 comments on commit d6db0d0

Please sign in to comment.