Skip to content

Commit ccc8b17

Browse files
committed
Only run tests if possible in env
1 parent 8e669f7 commit ccc8b17

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import {Filename, npath, ppath, xfs} from '@yarnpkg/fslib';
2-
import {ALLOWS_EXTENSIONLESS_FILES, HAS_LOADERS_AFFECTING_LOADERS, SUPPORTS_IMPORT_ATTRIBUTES, SUPPORTS_IMPORT_ATTRIBUTES_ONLY} from '@yarnpkg/pnp/sources/esm-loader/loaderFlags';
3-
import {pathToFileURL} from 'url';
1+
import {Filename, npath, ppath, xfs} from '@yarnpkg/fslib';
2+
import {ALLOWS_EXTENSIONLESS_FILES, HAS_LOADERS_AFFECTING_LOADERS, SUPPORTS_IMPORT_ATTRIBUTES, SUPPORTS_IMPORT_ATTRIBUTES_ONLY, SUPPORTS_TYPE_STRIPPING} from '@yarnpkg/pnp/sources/esm-loader/loaderFlags';
3+
import {pathToFileURL} from 'url';
44

55
describe(`Plug'n'Play - ESM`, () => {
66
test(
@@ -1161,7 +1161,7 @@ describe(`Plug'n'Play - ESM`, () => {
11611161
),
11621162
);
11631163

1164-
describe(`Node builtin type stripping`, () => {
1164+
(SUPPORTS_TYPE_STRIPPING ? describe : describe.skip)(`Node builtin type stripping`, () => {
11651165
it(
11661166
`should be able to resolve a .cts file`,
11671167
makeTemporaryEnv(

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ export const SUPPORTS_IMPORT_ATTRIBUTES = major >= 21 || (major === 20 && minor
2020

2121
// https://github.com/nodejs/node/pull/52104
2222
export const SUPPORTS_IMPORT_ATTRIBUTES_ONLY = major >= 22;
23+
24+
// https://github.com/nodejs/node/pull/53725
25+
export const SUPPORTS_TYPE_STRIPPING = major < 23 && minor < 6;

0 commit comments

Comments
 (0)