Skip to content

Commit

Permalink
Attempt to fix issue installing latest always
Browse files Browse the repository at this point in the history
  • Loading branch information
bouwkast committed Dec 24, 2024
1 parent 53272d5 commit cff1165
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions packages/dd-trace/test/setup/mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,18 @@ function withVersions (plugin, modules, range, cb) {
testVersions.set(min, { range: version, test: min })
}

// TODO may run into issues with the latest version being greater than supported Node
if (latestVersion) {
testVersions.set(latestVersion, { range: version, test: latestVersion })
// TODO may run into issues with the latest version being greater than supported Node?
if (latestVersion && !process.env.PACKAGE_VERSION_RANGE) {
const testVersion = semver.lte(version, latestVersion) ? version : latestVersion
testVersions.set(testVersion, { range: version, test: testVersion })
} else if (latestVersion) {
const range = process.env.PACKAGE_VERSION_RANGE
const testVersion = semver.satisfies(latestVersion, range)
? latestVersion
: semver.maxSatisfying([version, latestVersion], range)
if (testVersion) {
testVersions.set(testVersion, { range: version, test: testVersion })
}
} else {
const max = require(`../../../../versions/${moduleName}@${version}`).version()
testVersions.set(max, { range: version, test: version })
Expand Down

0 comments on commit cff1165

Please sign in to comment.