Bundle "Experimental CLI" (#17396)

This commit is contained in:
fisker Cheung authored and GitHub committed 2025-05-06 10:34:05 +08:00
1 parent 59c635b939
commit d4fd92e266
19 files changed
+303 -103

No files matched your search

+6 -4
View File
@@ -10,7 +10,7 @@ const TEST_STANDALONE = Boolean(process.env.TEST_STANDALONE);
const INSTALL_PACKAGE = Boolean(process.env.INSTALL_PACKAGE);
// When debugging production test, this flag can skip installing package
const SKIP_PRODUCTION_INSTALL = Boolean(process.env.SKIP_PRODUCTION_INSTALL);
const SKIP_TESTS_WITH_NEW_SYNTAX = process.versions.node.startsWith("14.");
const nodejsMajorVersion = Number(process.versions.node.split(".")[0]);
let PRETTIER_DIR = isProduction
? path.join(PROJECT_ROOT, "dist/prettier")
@@ -40,19 +40,21 @@ if (isProduction) {
);
}
if (SKIP_TESTS_WITH_NEW_SYNTAX || process.versions.node.startsWith("16.")) {
if (nodejsMajorVersion <= 16) {
// Uses import attributes
testPathIgnorePatterns.push(
"<rootDir>/tests/integration/__tests__/help-options.js",
);
}
if (SKIP_TESTS_WITH_NEW_SYNTAX) {
if (nodejsMajorVersion <= 14) {
testPathIgnorePatterns.push(
"<rootDir>/tests/integration/__tests__/plugin-parsers.js",
"<rootDir>/tests/integration/__tests__/normalize-doc.js",
"<rootDir>/tests/integration/__tests__/doc-utils-clean-doc.js",
"<rootDir>/tests/integration/__tests__/config-invalid.js",
// `@prettier/cli` uses `node:stream/consumers`, not available on Node.js v14
"<rootDir>/tests/integration/__tests__/experimental-cli.js",
// Fails on Node.js v14
"<rootDir>/tests/dts/unit/run.js",
);
@@ -63,7 +65,7 @@ const config = {
"<rootDir>/tests/config/format-test-setup.js",
"<rootDir>/tests/integration/integration-test-setup.js",
],
runner: "jest-light-runner/child-process",
runner: "jest-light-runner",
snapshotSerializers: [
"jest-snapshot-serializer-raw",
"jest-snapshot-serializer-ansi",