test: add test for deprecated option value
parent
98c45bb421
commit
d9fd340902
|
@ -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);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue