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:
Simon Lydell committed 2017-09-03 17:02:12 +02:00
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)
> 1 | this is invalid!
 |  ^
> 1 | this is invalid!
| ^
"
`;
+5 -1
View File
@@ -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);