2017-06-03 01:30:39 +03:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const runPrettier = require("../runPrettier");
|
|
|
|
|
2017-10-02 19:08:34 +03:00
|
|
|
describe("doesn't crash when --debug-check is passed", () => {
|
|
|
|
runPrettier("cli/with-shebang", ["issue1890.js", "--debug-check"]).test({
|
|
|
|
stdout: "issue1890.js\n",
|
|
|
|
stderr: "",
|
|
|
|
status: 0
|
|
|
|
});
|
2017-06-07 02:10:24 +03:00
|
|
|
});
|
|
|
|
|
2017-10-02 19:08:34 +03:00
|
|
|
describe("checks stdin with --debug-check", () => {
|
2018-12-27 16:05:19 +03:00
|
|
|
runPrettier("cli/with-shebang", ["--debug-check", "--parser", "babel"], {
|
2017-06-07 02:10:24 +03:00
|
|
|
input: "0"
|
2017-10-02 19:08:34 +03:00
|
|
|
}).test({
|
|
|
|
stdout: "(stdin)\n",
|
|
|
|
stderr: "",
|
|
|
|
status: 0
|
2017-06-07 02:10:24 +03:00
|
|
|
});
|
2017-06-03 01:30:39 +03:00
|
|
|
});
|
2017-10-07 12:36:43 +03:00
|
|
|
|
|
|
|
describe("show diff for 2+ error files with --debug-check", () => {
|
2018-04-25 17:10:22 +03:00
|
|
|
runPrettier("cli/debug-check", [
|
2018-11-14 15:55:50 +03:00
|
|
|
"--end-of-line",
|
|
|
|
"lf",
|
2018-04-25 17:10:22 +03:00
|
|
|
"*.debug-check",
|
|
|
|
"--debug-check",
|
|
|
|
"--plugin",
|
|
|
|
"./plugin-for-testing-debug-check"
|
|
|
|
]).test({
|
2017-10-07 12:36:43 +03:00
|
|
|
status: "non-zero"
|
|
|
|
});
|
|
|
|
});
|
2018-05-30 19:42:26 +03:00
|
|
|
|
2018-12-19 17:03:30 +03:00
|
|
|
describe("should not exit non-zero for already prettified code with --debug-check + --check", () => {
|
|
|
|
runPrettier("cli/debug-check", [
|
|
|
|
"issue-4599.js",
|
|
|
|
"--debug-check",
|
|
|
|
"--check"
|
|
|
|
]).test({
|
|
|
|
status: 0
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2018-05-30 19:42:26 +03:00
|
|
|
describe("should not exit non-zero for already prettified code with --debug-check + --list-different", () => {
|
|
|
|
runPrettier("cli/debug-check", [
|
|
|
|
"issue-4599.js",
|
|
|
|
"--debug-check",
|
|
|
|
"--list-different"
|
|
|
|
]).test({
|
|
|
|
status: 0
|
|
|
|
});
|
|
|
|
});
|