Files
test-repo/tests_integration/__tests__/debug-check.js
T
Danny McCormick 18b03a31cc Fix tests for Windows and add Azure Pipelines for cross platform CI (#5410)
* Add azure pipelines

* Add gitattributes

* Updating tests to work on Windows or Unix

* Lint

* Cleaning up

* Fixing names

* Clean up naming

* try to consolidate images

* Clean up

* Add back txt to gitattributes
2018-11-14 07:55:50 -05:00

45 lines
1020 B
JavaScript

"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: "",
status: 0
});
});
describe("checks stdin with --debug-check", () => {
runPrettier("cli/with-shebang", ["--debug-check", "--parser", "babylon"], {
input: "0"
}).test({
stdout: "(stdin)\n",
stderr: "",
status: 0
});
});
describe("show diff for 2+ error files with --debug-check", () => {
runPrettier("cli/debug-check", [
"--end-of-line",
"lf",
"*.debug-check",
"--debug-check",
"--plugin",
"./plugin-for-testing-debug-check"
]).test({
status: "non-zero"
});
});
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
});
});