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