prettierPath only works via CLI option, not config
See original GitHub issue🐛 Bug Report
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.
To Reproduce
Specify the prettierPath
option in a config file or --config
JSON object.
Expected behavior
The provided path will be used for Prettier.
Link to repl or repo (highly encouraged)
Please provide either a repl.it demo or a minimal repository on GitHub.
Issues without a reproduction link are likely to stall.
Run npx envinfo --preset jest
Paste 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
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
In VS Code, I'm getting this error, 'Failed to load module ...
When I go into VS Code settings, I search for Prettier Path . I see 2 options here, Prettier:Config Path and Prettier: Prettier...
Read more >CLI - Prettier
Use the `prettier` command to run Prettier from the command line. ... If no config file is found, CLI options will evaluate as...
Read more >How to configure Prettier and VSCode - Gleb Bahmutov
This blog post shows how to configure Prettier to work from command ... In the VSCode global settings, set this option to only...
Read more >Configuring Jest
The bail config option can be used here to have Jest stop running tests ... This option is only supported using the default...
Read more >Configuring Jest compiled - w3resource
When you are using the --config option, the JSON file should not contain ... The Jest philosophy works great by default, but there...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I refuse to believe this is intentional (if it is I’ll argue against it), so PR very much welcome 🙂
Definately not intentional