When specifying the prettierPath option in a config file or JSON object, it is ignored. Jest prints the warning:
Jest: Inline Snapshots requires Prettier.
Please ensure "prettier" is installed in your project.
By putting a console.log in the module at the specified prettierPath, it is apparent that Jest never even attempts to import the supplied path. The value that eventually makes it to getPrettier() in the jest-jasmine2 package is null.
Using the same value with --prettierPath via the CLI works.
Specify the prettierPath option in a config file or --config JSON object.
The provided path will be used for Prettier.
Please provide either a repl.it demo or a minimal repository on GitHub.
Issues without a reproduction link are likely to stall.
npx envinfo --preset jestPaste the results here:
npx: installed 1 in 2.496s
System:
OS: macOS 10.14.1
CPU: (4) x64 Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz
Binaries:
Node: 8.9.4 - ~/.nvm/versions/node/v8.9.4/bin/node
Yarn: 1.12.3 - /usr/local/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v8.9.4/bin/npm
npmPackages:
jest: ^23.6.0 => 23.6.0
It seems that argv has a default value for prettierPath and it overrides config file's prettierPath. I could do a PR, unless I am missing something and the default value is intentional.
Hmm, @azz is that intentional?
I refuse to believe this is intentional (if it is I'll argue against it), so PR very much welcome 馃檪
Definately not intentional
Most helpful comment
I refuse to believe this is intentional (if it is I'll argue against it), so PR very much welcome 馃檪