Skip to content

Commit

Permalink
test: fix range for parent URL test (#5463)
Browse files Browse the repository at this point in the history
**What's the problem this PR addresses?**

The test added in #5362 doesn't run
on Node.js v17.

Fixes
https://github.com/yarnpkg/berry/actions/runs/5060283241/jobs/9083017466

**How did you fix it?**

Updated the range to match Node.js versions containing
nodejs/node#42881

**Checklist**
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).
- [x] I have set the packages that need to be released for my changes to
be effective.
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.
  • Loading branch information
merceyz committed Jun 1, 2023
1 parent 18f3ee3 commit 1a5e983
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .yarn/versions/c594112e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declined:
- "@yarnpkg/pnp"
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ describe(`Plug'n'Play - ESM`, () => {
),
);

(loaderFlags.HAS_CONSOLIDATED_HOOKS ? test : test.skip)(
(loaderFlags.ALLOWS_NON_FILE_PARENT ? test : test.skip)(
`it should allow importing files regardless of parent URL`,
makeTemporaryEnv(
{
Expand Down
3 changes: 3 additions & 0 deletions packages/yarnpkg-pnp/sources/esm-loader/loaderFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ export const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || (major === 19 && min
// https://github.com/nodejs/node/pull/45659 changed the internal translators to be lazy loaded
// TODO: Update the version range if https://github.com/nodejs/node/pull/46425 lands.
export const HAS_LAZY_LOADED_TRANSLATORS = major > 19 || (major === 19 && minor >= 3);

// https://github.com/nodejs/node/pull/42881
export const ALLOWS_NON_FILE_PARENT = major > 18 || (major === 18 && minor >= 1) || (major === 16 && minor >= 17);

0 comments on commit 1a5e983

Please sign in to comment.