Add please-upgrade-node (#7837)
This commit is contained in:
1 parent
0d813b7d4a
commit
996d1cbb4f
5 files changed
+40
No files matched your search
@@ -53,6 +53,7 @@
|
||||
"minimatch": "3.0.4",
|
||||
"minimist": "1.2.5",
|
||||
"n-readlines": "1.0.0",
|
||||
"please-upgrade-node": "3.2.0",
|
||||
"postcss-less": "3.1.4",
|
||||
"postcss-media-query-parser": "0.2.3",
|
||||
"postcss-scss": "2.0.0",
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
require("please-upgrade-node")(require("../../package.json"));
|
||||
|
||||
const prettier = require("../../index");
|
||||
const stringify = require("json-stable-stringify");
|
||||
const util = require("./util");
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`node version error (stderr) 1`] = `
|
||||
"prettier requires at least version 10.13.0 of Node, please upgrade
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`node version error (stdout) 1`] = `""`;
|
||||
|
||||
exports[`node version error (write) 1`] = `Array []`;
|
||||
|
||||
exports[`show detailed usage with --help l (alias) (stderr) 1`] = `""`;
|
||||
|
||||
exports[`show detailed usage with --help l (alias) (stdout) 1`] = `
|
||||
|
||||
@@ -85,3 +85,19 @@ describe("throw error and show usage with something unexpected", () => {
|
||||
status: "non-zero",
|
||||
});
|
||||
});
|
||||
|
||||
describe("node version error", () => {
|
||||
const originalProcessVersion = process.version;
|
||||
try {
|
||||
Object.defineProperty(process, "version", {
|
||||
value: "v8.0.0",
|
||||
writable: false,
|
||||
});
|
||||
runPrettier("cli", ["--help"]).test({ status: 1 });
|
||||
} finally {
|
||||
Object.defineProperty(process, "version", {
|
||||
value: originalProcessVersion,
|
||||
writable: false,
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -6080,6 +6080,13 @@ platform@^1.3.3:
|
||||
resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.5.tgz#fb6958c696e07e2918d2eeda0f0bc9448d733444"
|
||||
integrity sha512-TuvHS8AOIZNAlE77WUDiR4rySV/VMptyMfcfeoMgs4P8apaZM3JrnbzBiixKUv+XR6i+BXrQh8WAnjaSPFO65Q==
|
||||
|
||||
please-upgrade-node@3.2.0:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942"
|
||||
integrity sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==
|
||||
dependencies:
|
||||
semver-compare "^1.0.0"
|
||||
|
||||
pn@^1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb"
|
||||
@@ -6832,6 +6839,11 @@ schema-utils@^2.6.4, schema-utils@^2.6.5:
|
||||
ajv "^6.12.0"
|
||||
ajv-keywords "^3.4.1"
|
||||
|
||||
semver-compare@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc"
|
||||
integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w=
|
||||
|
||||
"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.6.0:
|
||||
version "5.7.1"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
|
||||
|
||||
Reference in new issue
Block a user