Skip to content

Commit b83d6ac

Browse files
authored
Merge pull request #432 from storybookjs/docs/add-pnp-remark
Docs: Add remark regarding pnp support
2 parents 0b32f7f + 1209174 commit b83d6ac

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Storybook test runner turns all of your stories into executable tests.
4747
- [DOM snapshot (HTML)](#dom-snapshot-html)
4848
- [Image snapshot](#image-snapshot)
4949
- [Troubleshooting](#troubleshooting)
50+
- [Yarn PnP (Plug n' Play) support](#yarn-pnp-plug-n-play-support)
5051
- [React Native support](#react-native-support)
5152
- [The error output in the CLI is too short](#the-error-output-in-the-cli-is-too-short)
5253
- [The test runner seems flaky and keeps timing out](#the-test-runner-seems-flaky-and-keeps-timing-out)
@@ -983,6 +984,19 @@ export default config;
983984
984985
## Troubleshooting
985986
987+
#### Yarn PnP (Plug n' Play) support
988+
989+
The Storybook test-runner relies on a library called [jest-playwright-preset](https://github.com/playwright-community/jest-playwright), of which does not seem to support PnP. As a result, the test-runner won't work out of the box with PnP, and you might have the following error:
990+
991+
```
992+
PlaywrightError: jest-playwright-preset: Cannot find playwright package to use chromium
993+
```
994+
995+
If that is the case, there are two potential solutions:
996+
997+
1. Install `playwright` as a direct dependency. You might need to run `yarn playwright install` after that, so you install Playwright's browser binaries.
998+
2. Switch your package manager's linker mode to `node-modules`.
999+
9861000
#### React Native support
9871001
9881002
The test-runner is web based and therefore won't work with `@storybook/react-native` directly. However, if you use the [React Native Web Storybook Addon](https://storybook.js.org/addons/%2540storybook/addon-react-native-web), you can run the test-runner against the web-based Storybook generated with that addon. In that case, things would work the same way.

0 commit comments

Comments
 (0)