test: add test for deprecated option value

master
ikatyang 2017-09-08 12:36:00 +08:00
parent 98c45bb421
commit d9fd340902
2 changed files with 21 additions and 0 deletions

View File

@ -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\\");
"

View File

@ -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);
});