Skip to content

Commit

Permalink
Merge pull request #2 from mbland/improve-testenvpath
Browse files Browse the repository at this point in the history
Improve testEnvPath construction in main.test.js
  • Loading branch information
mbland committed Dec 28, 2023
2 parents d62f081 + 0005dd9 commit b5e59a8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/main.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ describe('jsdoc-cli-wrapper', () => {

try {
const jsdocPath = await getPath('jsdoc', process.env, process.platform)
const jsdocDir = path.dirname(jsdocPath).replaceAll('\\', '\\\\')
const pat = new RegExp(`${path.delimiter}?${jsdocDir}${path.delimiter}?`)
testEnvPath = testEnvPath.replace(pat, '')
const jsdocDir = path.dirname(jsdocPath)
testEnvPath = testEnvPath.split(path.delimiter)
.filter(p => p !== jsdocDir)
.join(path.delimiter)
} catch { /* It's OK if it's not actually installed. */ }

return spawnMain(testEnvPath, ...argv)
Expand Down

0 comments on commit b5e59a8

Please sign in to comment.