Files
test-repo/tests_integration/__tests__/debug-check.js
T

54 lines
1.2 KiB
JavaScript
Raw Normal View History

"use strict";
const runPrettier = require("../runPrettier");
describe("doesn't crash when --debug-check is passed", () => {
runPrettier("cli/with-shebang", ["issue1890.js", "--debug-check"]).test({
stdout: "issue1890.js\n",
stderr: "",
2020-03-21 22:07:52 +02:00
status: 0,
});
});
describe("checks stdin with --debug-check", () => {
2018-12-27 08:05:19 -05:00
runPrettier("cli/with-shebang", ["--debug-check", "--parser", "babel"], {
2020-03-21 22:07:52 +02:00
input: "0",
}).test({
stdout: "(stdin)\n",
stderr: "",
2020-03-21 22:07:52 +02:00
status: 0,
});
});
describe("show diff for 2+ error files with --debug-check", () => {
2018-04-25 22:10:22 +08:00
runPrettier("cli/debug-check", [
"--end-of-line",
"lf",
2018-04-25 22:10:22 +08:00
"*.debug-check",
"--debug-check",
"--plugin",
2020-03-21 22:07:52 +02:00
"./plugin-for-testing-debug-check",
2018-04-25 22:10:22 +08:00
]).test({
2020-03-21 22:07:52 +02:00
status: "non-zero",
});
});
2018-12-19 14:03:30 +00:00
describe("should not exit non-zero for already prettified code with --debug-check + --check", () => {
runPrettier("cli/debug-check", [
"issue-4599.js",
"--debug-check",
2020-03-21 22:07:52 +02:00
"--check",
2018-12-19 14:03:30 +00:00
]).test({
2020-03-21 22:07:52 +02:00
status: 0,
2018-12-19 14:03:30 +00: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",
2020-03-21 22:07:52 +02:00
"--list-different",
]).test({
2020-03-21 22:07:52 +02:00
status: 0,
});
});