Skip to content

Commit 4da62cf

Browse files
committed
refactor: rename flag
1 parent 47d7d7f commit 4da62cf

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

packages/acceptance-tests/pkg-tests-specs/sources/pnp-esm.test.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import {nodeUtils} from '@yarnpkg/core';
2-
import {Filename, npath, ppath, xfs} from '@yarnpkg/fslib';
3-
import {HAS_LOADER_CHAINING} from '@yarnpkg/pnp/sources/esm-loader/loaderFlags';
4-
import {pathToFileURL} from 'url';
1+
import {nodeUtils} from '@yarnpkg/core';
2+
import {Filename, npath, ppath, xfs} from '@yarnpkg/fslib';
3+
import {HAS_LOADERS_AFFECTING_LOADERS} from '@yarnpkg/pnp/sources/esm-loader/loaderFlags';
4+
import {pathToFileURL} from 'url';
55

66
const ifAtLeastNode21It = nodeUtils.major >= 21 ? it : it.skip;
77
const ifAtMostNode20It = nodeUtils.major <= 20 ? it : it.skip;
@@ -779,7 +779,7 @@ describe(`Plug'n'Play - ESM`, () => {
779779
);
780780

781781
// Tests /packages/yarnpkg-pnp/sources/esm-loader/fspatch.ts
782-
(HAS_LOADER_CHAINING ? it : it.skip)(
782+
(HAS_LOADERS_AFFECTING_LOADERS ? it : it.skip)(
783783
`should support loaders importing named exports from commonjs files`,
784784
makeTemporaryEnv(
785785
{

packages/yarnpkg-pnp/sources/esm-loader/loaderFlags.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ export const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || (major === 19 && min
99
export const HAS_LAZY_LOADED_TRANSLATORS = (major === 20 && minor < 6) || (major === 19 && minor >= 3);
1010

1111
// https://github.com/nodejs/node/pull/43772
12-
export const HAS_LOADER_CHAINING = major > 19 || (major === 19 && minor >= 6);
12+
// TODO: Update the version range if it gets backported to v18.
13+
export const HAS_LOADERS_AFFECTING_LOADERS = major > 19 || (major === 19 && minor >= 6);

0 commit comments

Comments
 (0)