test: add test for deprecated option value

This commit is contained in:
ikatyang committed 2017-09-08 12:36:00 +08:00
1 parent 98c45bb421
commit d9fd340902
2 files changed
+21

No files matched your search

@@ -7,6 +7,16 @@ exports[`boolean flags do not swallow the next argument 1`] = `
exports[`boolean flags do not swallow the next argument 2`] = `""`;
exports[`deprecated option values are warned 1`] = `
"console.log(\\"could be single quote and without semi\\");
"
`;
exports[`deprecated option values are warned 2`] = `
"Warning: \`--trailing-comma\` was used without an argument. This is deprecated. Specify \\"none\\", \\"es5\\", or \\"all\\".
"
`;
exports[`deprecated options are warned 1`] = `
"console.log(\\"could be single quote and without semi\\");
"
@@ -41,3 +41,14 @@ test("deprecated options are warned", () => {
expect(result.stderr).toMatchSnapshot();
expect(result.status).toEqual(0);
});
test("deprecated option values are warned", () => {
const result = runPrettier("cli/arg-parsing", [
"file.js",
"--trailing-comma"
]);
expect(result.stdout).toMatchSnapshot();
expect(result.stderr).toMatchSnapshot();
expect(result.status).toEqual(0);
});