From ed8fede3e69c8f6fcf58c8c3493168bd0b3b4b90 Mon Sep 17 00:00:00 2001 From: Ian VanSchooten Date: Fri, 12 Sep 2025 10:19:05 -0400 Subject: [PATCH 1/2] Do not use "_" in testTimeout examples Jest apparently can't handle it, and it won't apply the setting --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9a8e301c..05de4b17 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ Usage: test-storybook [options] | `--url` | Define the URL to run tests in. Useful for custom Storybook URLs
`test-storybook --url http://the-storybook-url-here.com` | | `--browsers` | Define browsers to run tests in. One or multiple of: chromium, firefox, webkit
`test-storybook --browsers firefox chromium` | | `--maxWorkers [amount]` | Specifies the maximum number of workers the worker-pool will spawn for running tests
`test-storybook --maxWorkers=2` | -| `--testTimeout [number]` | This option sets the default timeouts of test cases
`test-storybook --testTimeout=15_000` | +| `--testTimeout [number]` | This option sets the default timeouts of test cases
`test-storybook --testTimeout=15000` | | `--no-cache` | Disable the cache
`test-storybook --no-cache` | | `--clearCache` | Deletes the Jest cache directory and then exits without running tests
`test-storybook --clearCache` | | `--verbose` | Display individual test results with the test suite hierarchy
`test-storybook --verbose` | @@ -1073,10 +1073,10 @@ In either way, to fix it you should limit the amount of workers that run in para } ``` -Another option is trying to increase the test timeout by passing the [--testTimeout](https://jestjs.io/docs/cli#--testtimeoutnumber) option to your command (adding `--testTimeout=60_000` will increase test timeouts to 1 minute): +Another option is trying to increase the test timeout by passing the [--testTimeout](https://jestjs.io/docs/cli#--testtimeoutnumber) option to your command (adding `--testTimeout=60000` will increase test timeouts to 1 minute): ```json -"test-storybook:ci": "concurrently -k -s first -n \"SB,TEST\" -c \"magenta,blue\" \"yarn build-storybook --quiet && npx http-server storybook-static --port 6006 --silent\" \"wait-on tcp:6006 && yarn test-storybook --maxWorkers=2 --testTimeout=60_000\"" +"test-storybook:ci": "concurrently -k -s first -n \"SB,TEST\" -c \"magenta,blue\" \"yarn build-storybook --quiet && npx http-server storybook-static --port 6006 --silent\" \"wait-on tcp:6006 && yarn test-storybook --maxWorkers=2 --testTimeout=60000\"" ``` #### The test runner reports "No tests found" running on a Windows CI From 9fc3f612a3ac6024d0f67a477e9cdaccad3aa966 Mon Sep 17 00:00:00 2001 From: Ian VanSchooten Date: Fri, 12 Sep 2025 10:19:26 -0400 Subject: [PATCH 2/2] Clarify wording slightly --- README.md | 2 +- src/util/getParsedCliOptions.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 05de4b17..e336ab83 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ Usage: test-storybook [options] | `--url` | Define the URL to run tests in. Useful for custom Storybook URLs
`test-storybook --url http://the-storybook-url-here.com` | | `--browsers` | Define browsers to run tests in. One or multiple of: chromium, firefox, webkit
`test-storybook --browsers firefox chromium` | | `--maxWorkers [amount]` | Specifies the maximum number of workers the worker-pool will spawn for running tests
`test-storybook --maxWorkers=2` | -| `--testTimeout [number]` | This option sets the default timeouts of test cases
`test-storybook --testTimeout=15000` | +| `--testTimeout [number]` | This option sets the timeout of each test case
`test-storybook --testTimeout=15000` | | `--no-cache` | Disable the cache
`test-storybook --no-cache` | | `--clearCache` | Deletes the Jest cache directory and then exits without running tests
`test-storybook --clearCache` | | `--verbose` | Display individual test results with the test suite hierarchy
`test-storybook --verbose` | diff --git a/src/util/getParsedCliOptions.ts b/src/util/getParsedCliOptions.ts index eb15a9d7..9ee29b22 100644 --- a/src/util/getParsedCliOptions.ts +++ b/src/util/getParsedCliOptions.ts @@ -39,7 +39,7 @@ export const getParsedCliOptions = (): ParsedCliOptions => { '--maxWorkers ', 'Specifies the maximum number of workers the worker-pool will spawn for running tests' ) - .option('--testTimeout ', 'This option sets the default timeouts of test cases') + .option('--testTimeout ', 'This option sets the timeout of each test case') .option('--no-cache', 'Disable the cache') .option('--clearCache', 'Deletes the Jest cache directory and then exits without running tests') .option('--verbose', 'Display individual test results with the test suite hierarchy')