Closed
Description
🐛 Bug Report
Prettier is used by jest for toMatchInlineSnapshot
, but since it's not a dependency of jest
, toMatchInlineSnapshot
only works if some other package depends on prettier (or it's in the user's package.json
).
To Reproduce
Steps to reproduce the behavior:
- Make a new directory and run
yarn init --yes
inside it - Run
yarn add jest
- Create a test using the
toMatchInlineSnapshot
matcher, eg:expect(2 + 2).toMatchInlineSnapshot()
- Notice that the test fails with an error indicating that prettier cannot be found.
Expected behavior
Test passes with no issues
npx envinfo --preset jest
System:
OS: macOS 10.14.4
CPU: x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Binaries:
Node: 12.1.0 - /usr/local/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
npmPackages:
jest: 24.8.0 => 24.8.0