Files
wehub-resource-sync 70bf21e064
Handle Changesets / Handle Changesets (push) Waiting to run
Semgrep OSS scan / semgrep-oss (push) Waiting to run
Deploy (to testing) and Test Playground Preview Worker / Deploy Playground Preview Worker (testing) (push) Has been skipped
Deploy Workers Shared Staging / Deploy Workers Shared Staging (push) Failing after 0s
Prerelease / build (push) Has been skipped
chore: import upstream snapshot with attribution
2026-07-13 12:30:11 +08:00

24 lines
670 B
JavaScript

#!/usr/bin/env node
/**
* Output NODE_OPTIONS for tests based on Node version.
*
* Node 25+ has native localStorage enabled by default, which conflicts with MSW.
* We need to disable it using --no-experimental-webstorage, but this flag
* doesn't exist in Node 20-24.
*/
const major = parseInt(process.versions.node.split(".")[0], 10);
const options = [];
// Node 25+ has native webstorage enabled by default, disable it for MSW compatibility
if (major >= 25) {
options.push("--no-experimental-webstorage");
}
// Preserve existing NODE_OPTIONS
if (process.env.NODE_OPTIONS) {
options.push(process.env.NODE_OPTIONS);
}
process.stdout.write(options.join(" "));