diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ca0923a90c7..c33a369dec79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,6 +75,7 @@ - `[jest-haste-map]` [**BREAKING**] Recover files correctly after haste name collisions are fixed ([#7329](https://github.com/facebook/jest/pull/7329)) - `[jest-haste-map]` Remove legacy condition for duplicate module detection ([#7333](https://github.com/facebook/jest/pull/7333)) - `[jest-haste-map]` Fix `require` detection with trailing commas and ignore `import typeof` modules ([#7385](https://github.com/facebook/jest/pull/7385)) +- `[jest-cli]` Fix to set prettierPath via config file ([#7412](https://github.com/facebook/jest/pull/7412)) ### Chore & Maintenance diff --git a/e2e/__tests__/__snapshots__/show_config.test.js.snap b/e2e/__tests__/__snapshots__/show_config.test.js.snap index 24f419707d6d..9e3a43419f56 100644 --- a/e2e/__tests__/__snapshots__/show_config.test.js.snap +++ b/e2e/__tests__/__snapshots__/show_config.test.js.snap @@ -36,7 +36,7 @@ exports[`--showConfig outputs config info and exits 1`] = ` \\"moduleNameMapper\\": {}, \\"modulePathIgnorePatterns\\": [], \\"name\\": \\"[md5 hash]\\", - \\"prettierPath\\": null, + \\"prettierPath\\": \\"prettier\\", \\"resetMocks\\": false, \\"resetModules\\": false, \\"resolver\\": null, diff --git a/packages/jest-cli/src/cli/args.js b/packages/jest-cli/src/cli/args.js index 99e92b21f959..7782f549e360 100644 --- a/packages/jest-cli/src/cli/args.js +++ b/packages/jest-cli/src/cli/args.js @@ -425,7 +425,7 @@ export const options = { type: 'string', }, prettierPath: { - default: 'prettier', + default: undefined, description: 'The path to the "prettier" module used for inline snapshots.', type: 'string', }, diff --git a/types/Argv.js b/types/Argv.js index 966c82327dbd..30a67a4fa44f 100644 --- a/types/Argv.js +++ b/types/Argv.js @@ -62,6 +62,7 @@ export type Argv = {| outputFile: string, preset: ?string, projects: Array, + prettierPath: ?string, replname: ?string, resetMocks: boolean, resetModules: boolean,