test: add test for `--flow-parser`

master
ikatyang 2017-09-08 11:45:59 +08:00
parent 0630d174ab
commit b13a104a7b
2 changed files with 18 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 options are warned 1`] = `
"console.log(\\"could be single quote and without semi\\");
"
`;
exports[`deprecated options are warned 2`] = `
"\`--flow-parser\` is deprecated. Use \`--parser flow\` instead.
"
`;
exports[`negated options work 1`] = `
"console.log(\\"could be single quote and without semi\\")
"

View File

@ -33,3 +33,11 @@ test("unknown negated options are warned", () => {
expect(result.stderr).toMatchSnapshot();
expect(result.status).toEqual(0);
});
test("deprecated options are warned", () => {
const result = runPrettier("cli/arg-parsing", ["file.js", "--flow-parser"]);
expect(result.stdout).toMatchSnapshot();
expect(result.stderr).toMatchSnapshot();
expect(result.status).toEqual(0);
});