prettier/tests_integration/__tests__/stdin-filepath.js

24 lines
533 B
JavaScript
Raw Normal View History

2017-09-08 10:08:19 +03:00
"use strict";
const runPrettier = require("../runPrettier");
describe("format correctly if stdin content compatible with stdin-filepath", () => {
runPrettier(
2017-09-08 10:08:19 +03:00
"cli",
["--stdin-filepath", "abc.css"],
2017-09-08 10:08:19 +03:00
{ input: ".name { display: none; }" } // css
).test({
status: 0
});
2017-09-08 10:08:19 +03:00
});
describe("throw error if stdin content incompatible with stdin-filepath", () => {
runPrettier(
2017-09-08 10:08:19 +03:00
"cli",
["--stdin-filepath", "abc.js"],
2017-09-08 10:08:19 +03:00
{ input: ".name { display: none; }" } // css
).test({
status: "non-zero"
});
2017-09-08 10:08:19 +03:00
});