Skip to content

Commit

Permalink
improved test running
Browse files Browse the repository at this point in the history
  • Loading branch information
arshaw committed Jan 29, 2024
1 parent 0f74cbf commit 33777fa
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Really picky about whitespace between characters
# Nothing we can do about this since it relies on Intl.DateTimeFormat
staging/Intl402/Temporal/old/date-time-format.js
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ intl402/DateTimeFormat/constructor-options-timeZoneName-valid.js
intl402/Temporal/TimeZone/supported-values-of.js
intl402/Temporal/TimeZone/prototype/equals/canonical-not-equal.js
intl402/Temporal/TimeZone/prototype/equals/timezone-case-insensitive.js
intl402/Temporal/TimeZone/from/timezone-case-insensitive.js
intl402/Temporal/ZonedDateTime/from/timezone-case-insensitive.js

intl402/Temporal/TimeZone/prototype/getNextTransition/transition-at-instant-boundaries.js
intl402/Temporal/TimeZone/prototype/getPreviousTransition/transition-at-instant-boundaries.js
Expand Down
13 changes: 8 additions & 5 deletions packages/temporal-polyfill/scripts/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ yargs(hideBin(process.argv))
const currentNodeVersion = process.versions.node
const currentNodeMajorVersion = parseInt(currentNodeVersion.split('.')[0])

// If different version of Node requested, spawn a new process
if (
options.nodeVersion &&
options.nodeVersion !== currentNodeVersion &&
Expand All @@ -66,8 +67,7 @@ yargs(hideBin(process.argv))
cwd: process.cwd(),
env: {
...filterEnv(process.env),
// will force PNPM to use a specific version (see .npmrc)
NODE_VERSION: options.nodeVersion,
NODE_VERSION: options.nodeVersion, // forces PNPM to use specific version (see .npmrc)
}
})
}
Expand All @@ -78,17 +78,18 @@ yargs(hideBin(process.argv))
]

if (currentNodeMajorVersion >= 18) {
expectedFailureFiles.push('expected-failures-intl-format-norm.txt')
expectedFailureFiles.push('expected-failures-node-gte18.txt')
}
if (currentNodeMajorVersion < 18) {
expectedFailureFiles.push('expected-failures-before-node18.txt')
expectedFailureFiles.push('expected-failures-node-lt18.txt')
}
if (currentNodeMajorVersion < 16) {
expectedFailureFiles.push('expected-failures-before-node16.txt')
expectedFailureFiles.push('expected-failures-node-lt16.txt')
}

let { esm, min } = options

// Let CI decide. Try all permutations based on Node LTS version
if (process.env.CI) {
esm = esm || Boolean(Math.floor(currentNodeMajorVersion / 4) % 2)
min = min || Boolean(Math.floor(currentNodeMajorVersion / 2) % 2)
Expand Down Expand Up @@ -142,6 +143,8 @@ function liveExec(cmdParts, options = {}) {
})
}

// Filter away Node-related environment variables because prevents
// PNPM's use-node-version from being reset
function filterEnv(oldEnv) {
const newEnv = {}

Expand Down

0 comments on commit 33777fa

Please sign in to comment.