Fix failing test on Travis CI
Chalk disables colors in CI environments, making the test pass locally but not on Travis CI. This also makes the snapshot more readable.
This commit is contained in:
1 parent
fd025a855e
commit
58350cbe59
2 files changed
+7
-3
No files matched your search
@@ -2,8 +2,8 @@
|
||||
|
||||
exports[`do not write file with --write + invalid file 1`] = `
|
||||
"invalid.js: SyntaxError: Unexpected token, expected ; (1:6)
|
||||
[0m[31m[1m>[22m[39m[90m 1 | [39m[36mthis[39m is invalid[33m![39m
|
||||
[90m | [39m [31m[1m^[22m[39m[0m
|
||||
> 1 | this is invalid!
|
||||
| ^
|
||||
"
|
||||
`;
|
||||
|
||||
|
||||
@@ -17,7 +17,11 @@ test("do not write file with --write + formated file", () => {
|
||||
});
|
||||
|
||||
test("do not write file with --write + invalid file", () => {
|
||||
const result = runPrettier("cli/write", ["--write", "invalid.js"]);
|
||||
const result = runPrettier("cli/write", [
|
||||
"--write",
|
||||
"invalid.js",
|
||||
"--no-color"
|
||||
]);
|
||||
|
||||
expect(result.stderr).toMatchSnapshot();
|
||||
expect(result.write).toHaveLength(0);
|
||||
|
||||
Reference in new issue
Block a user