Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Add remark regarding pnp support #432

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Storybook test runner turns all of your stories into executable tests.
- [DOM snapshot (HTML)](#dom-snapshot-html)
- [Image snapshot](#image-snapshot)
- [Troubleshooting](#troubleshooting)
- [Yarn PnP (Plug n' Play) support](#yarn-pnp-plug-n-play-support)
- [React Native support](#react-native-support)
- [The error output in the CLI is too short](#the-error-output-in-the-cli-is-too-short)
- [The test runner seems flaky and keeps timing out](#the-test-runner-seems-flaky-and-keeps-timing-out)
Expand Down Expand Up @@ -983,6 +984,19 @@ export default config;

## Troubleshooting

#### Yarn PnP (Plug n' Play) support

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:

```
PlaywrightError: jest-playwright-preset: Cannot find playwright package to use chromium
```

If that is the case, there are two potential solutions:

1. Install `playwright` as a direct dependency. You might need to run `yarn playwright install` after that, so you install Playwright's browser binaries.
2. Switch your package manager's linker mode to `node-modules`.

#### React Native support

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.
Expand Down
Loading