From 740607eb105760c7c66e0694f32efc0f4e015c7a Mon Sep 17 00:00:00 2001 From: Kaelig Deloumeau-Prigent Date: Sat, 7 Dec 2024 08:34:57 -0800 Subject: [PATCH] Add listTests flag from Jest --- README.md | 1 + src/util/getParsedCliOptions.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 96fb09a7..4d4f375a 100644 --- a/README.md +++ b/README.md @@ -167,6 +167,7 @@ Usage: test-storybook [options] | `--json` | Prints the test results in JSON. This mode will send all other test output and user messages to stderr.
`test-storybook --json` | | `--outputFile` | Write test results to a file when the --json option is also specified.
`test-storybook --json --outputFile results.json` | | `--junit` | Indicates that test information should be reported in a junit file.
`test-storybook --**junit**` | +| `--listTests` | Lists all test files that will be run, and exits
`test-storybook --listTests` | | `--ci` | Instead of the regular behavior of storing a new snapshot automatically, it will fail the test and require Jest to be run with `--updateSnapshot`.
`test-storybook --ci` | | `--shard [shardIndex/shardCount]` | Splits your test suite across different machines to run in CI.
`test-storybook --shard=1/3` | | `--failOnConsole` | Makes tests fail on browser console errors
`test-storybook --failOnConsole` | diff --git a/src/util/getParsedCliOptions.ts b/src/util/getParsedCliOptions.ts index 60a751e2..89e70d01 100644 --- a/src/util/getParsedCliOptions.ts +++ b/src/util/getParsedCliOptions.ts @@ -65,6 +65,10 @@ export const getParsedCliOptions = (): ParsedCliOptions => { 'coverage/storybook' ) .option('--junit', 'Indicates that test information should be reported in a junit file') + .option( + '--listTests', + 'Lists all test files that will be run, and exits' + ) .option( '--eject', 'Creates a local configuration file to override defaults of the test-runner. Use it only if you want to have better control over the runner configurations'