Skip to content

Commit

Permalink
Only run tests if possible in env
Browse files Browse the repository at this point in the history
  • Loading branch information
RDIL committed Jan 21, 2025
1 parent 8e669f7 commit ccc8b17
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Filename, npath, ppath, xfs} from '@yarnpkg/fslib';
import {ALLOWS_EXTENSIONLESS_FILES, HAS_LOADERS_AFFECTING_LOADERS, SUPPORTS_IMPORT_ATTRIBUTES, SUPPORTS_IMPORT_ATTRIBUTES_ONLY} from '@yarnpkg/pnp/sources/esm-loader/loaderFlags';
import {pathToFileURL} from 'url';
import {Filename, npath, ppath, xfs} from '@yarnpkg/fslib';
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';
import {pathToFileURL} from 'url';

describe(`Plug'n'Play - ESM`, () => {
test(
Expand Down Expand Up @@ -1161,7 +1161,7 @@ describe(`Plug'n'Play - ESM`, () => {
),
);

describe(`Node builtin type stripping`, () => {
(SUPPORTS_TYPE_STRIPPING ? describe : describe.skip)(`Node builtin type stripping`, () => {
it(
`should be able to resolve a .cts file`,
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 @@ -20,3 +20,6 @@ export const SUPPORTS_IMPORT_ATTRIBUTES = major >= 21 || (major === 20 && minor

// https://github.com/nodejs/node/pull/52104
export const SUPPORTS_IMPORT_ATTRIBUTES_ONLY = major >= 22;

// https://github.com/nodejs/node/pull/53725
export const SUPPORTS_TYPE_STRIPPING = major < 23 && minor < 6;

0 comments on commit ccc8b17

Please sign in to comment.