From b13a104a7b530b0d5891b8820562d69722e08586 Mon Sep 17 00:00:00 2001 From: ikatyang Date: Fri, 8 Sep 2017 11:45:59 +0800 Subject: [PATCH] test: add test for `--flow-parser` --- .../__tests__/__snapshots__/arg-parsing.js.snap | 10 ++++++++++ tests_integration/__tests__/arg-parsing.js | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/tests_integration/__tests__/__snapshots__/arg-parsing.js.snap b/tests_integration/__tests__/__snapshots__/arg-parsing.js.snap index 88c70b7e..709660a5 100644 --- a/tests_integration/__tests__/__snapshots__/arg-parsing.js.snap +++ b/tests_integration/__tests__/__snapshots__/arg-parsing.js.snap @@ -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\\") " diff --git a/tests_integration/__tests__/arg-parsing.js b/tests_integration/__tests__/arg-parsing.js index 553a4ff2..69478d00 100644 --- a/tests_integration/__tests__/arg-parsing.js +++ b/tests_integration/__tests__/arg-parsing.js @@ -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); +});