-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
list-different.js
50 lines (44 loc) · 1.03 KB
/
list-different.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
"use strict";
const runPrettier = require("../runPrettier");
describe("checks stdin with --list-different", () => {
runPrettier("cli/with-shebang", ["--list-different", "--parser", "babel"], {
input: "0"
}).test({
stdout: "(stdin)\n",
stderr: "",
status: "non-zero"
});
});
describe("checks stdin with -l (alias for --list-different)", () => {
runPrettier("cli/with-shebang", ["-l", "--parser", "babel"], {
input: "0"
}).test({
stdout: "(stdin)\n",
stderr: "",
status: "non-zero"
});
});
describe("--list-different works in CI just as in a non-TTY mode", () => {
const result0 = runPrettier(
"cli/write",
["--list-different", "formatted.js", "unformatted.js"],
{
env: {
CI: "true"
},
stdoutIsTTY: true
}
).test({
status: 1
});
const result1 = runPrettier(
"cli/write",
["--list-different", "formatted.js", "unformatted.js"],
{
stdoutIsTTY: false
}
).test({
status: 1
});
expect(result0.stdout).toEqual(result1.stdout);
});