2017-10-02 11:08:34 -05:00
|
|
|
describe("doesn't crash when --debug-check is passed", () => {
|
2023-04-11 08:44:23 +08:00
|
|
|
runCli("cli/with-shebang", ["issue1890.js", "--debug-check"]).test({
|
2023-03-30 14:25:28 +08:00
|
|
|
stdout: "issue1890.js",
|
2017-10-02 11:08:34 -05:00
|
|
|
stderr: "",
|
|
|
|
|
status: 0,
|
|
|
|
|
});
|
2017-06-06 19:10:24 -04:00
|
|
|
});
|
|
|
|
|
|
2017-10-02 11:08:34 -05:00
|
|
|
describe("checks stdin with --debug-check", () => {
|
2023-04-11 08:44:23 +08:00
|
|
|
runCli("cli/with-shebang", ["--debug-check", "--parser", "babel"], {
|
2017-06-06 19:10:24 -04:00
|
|
|
input: "0",
|
2017-10-02 11:08:34 -05:00
|
|
|
}).test({
|
2023-03-30 14:25:28 +08:00
|
|
|
stdout: "(stdin)",
|
2017-10-02 11:08:34 -05:00
|
|
|
stderr: "",
|
|
|
|
|
status: 0,
|
2017-06-06 19:10:24 -04:00
|
|
|
});
|
2017-06-02 18:30:39 -04:00
|
|
|
});
|
2017-10-07 04:36:43 -05:00
|
|
|
|
|
|
|
|
describe("show diff for 2+ error files with --debug-check", () => {
|
2023-04-11 08:44:23 +08:00
|
|
|
runCli("cli/debug-check", [
|
2018-11-14 07:55:50 -05:00
|
|
|
"--end-of-line",
|
|
|
|
|
"lf",
|
2018-04-25 22:10:22 +08:00
|
|
|
"*.debug-check",
|
|
|
|
|
"--debug-check",
|
|
|
|
|
"--plugin",
|
2021-12-03 15:41:12 +08:00
|
|
|
"./plugin-for-testing-debug-check.cjs",
|
2018-04-25 22:10:22 +08:00
|
|
|
]).test({
|
2017-10-07 04:36:43 -05:00
|
|
|
status: "non-zero",
|
|
|
|
|
});
|
|
|
|
|
});
|
2018-05-31 00:42:26 +08:00
|
|
|
|
2018-12-19 14:03:30 +00:00
|
|
|
describe("should not exit non-zero for already prettified code with --debug-check + --check", () => {
|
2023-04-11 08:44:23 +08:00
|
|
|
runCli("cli/debug-check", ["issue-4599.js", "--debug-check", "--check"]).test(
|
|
|
|
|
{
|
|
|
|
|
status: 0,
|
|
|
|
|
},
|
|
|
|
|
);
|
2018-12-19 14:03:30 +00:00
|
|
|
});
|
|
|
|
|
|
2018-05-31 00:42:26 +08:00
|
|
|
describe("should not exit non-zero for already prettified code with --debug-check + --list-different", () => {
|
2023-04-11 08:44:23 +08:00
|
|
|
runCli("cli/debug-check", [
|
2018-05-31 00:42:26 +08:00
|
|
|
"issue-4599.js",
|
|
|
|
|
"--debug-check",
|
|
|
|
|
"--list-different",
|
|
|
|
|
]).test({
|
|
|
|
|
status: 0,
|
|
|
|
|
});
|
|
|
|
|
});
|
2023-07-16 12:33:13 +08:00
|
|
|
|
|
|
|
|
describe("should not exit non-zero for jsx style element with spread attribute", () => {
|
|
|
|
|
runCli("cli/debug-check", ["issue-15094.jsx", "--debug-check"]).test({
|
|
|
|
|
status: 0,
|
|
|
|
|
});
|
|
|
|
|
});
|