test-runner
test-runner copied to clipboard
[Bug] Jest --findRelatedTests is not supported
Describe the bug
test-storybook
supports most of the Jest CLI options, but --findRelatedTests
is not one of them.
Steps to reproduce the behavior
yarn test-storybook --findRelatedTests src/my-changed-file.js
Expected behavior
Storybook passes the findRelatedTests
option to Jest, and any tests/stories that depend on src/my-changed-file.js
are run.
Actual behavior
error: unknown option '--findRelatedTests'
Environment
- OS: OS X
- Node.js version: v16.14.2
- NPM version: 8.5.0
I'm guessing it would need to be added to this file.
https://github.com/storybookjs/test-runner/blob/next/src/util/getParsedCliOptions.ts
I had a similar problem but with --passWithNoTests
. The following syntax helped me:
test-storybook --coverage -- --passWithNoTests
Pay attention to the --
part.