From 47f46c8a7f4adc3ba0eb5cebf7322ee4ca68268e Mon Sep 17 00:00:00 2001 From: jonniebigodes Date: Thu, 23 May 2024 21:13:50 +0100 Subject: [PATCH] Docs: Test runner add missing flag to the CLI options --- docs/writing-tests/test-runner.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/writing-tests/test-runner.md b/docs/writing-tests/test-runner.md index 6a39b2362ad3..759111e8ad9d 100644 --- a/docs/writing-tests/test-runner.md +++ b/docs/writing-tests/test-runner.md @@ -94,6 +94,7 @@ If you're already using any of those flags in your project, you should be able t | `--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 [amount]` | Defines the maximum time in milliseconds that a test can run before it is automatically marked as failed. Useful for long-running tests
`test-storybook --testTimeout=60000` | | `--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` | @@ -202,12 +203,12 @@ The test-runner renders a story and executes its [play function](../writing-stor The test-runner exports test hooks that can be overridden globally to enable use cases like visual or DOM snapshots. These hooks give you access to the test lifecycle _before_ and _after_ the story is rendered. Listed below are the available hooks and an overview of how to use them. -| Hook | Description | -| ----------- | ------------------------------------------------------------------------------------------------------------ | -| `prepare` | Prepares the browser for tests
`async prepare({ page, browserContext, testRunnerConfig }) {}` | -| `setup` | Executes once before all the tests run
`setup() {}` | +| Hook | Description | +| ----------- | --------------------------------------------------------------------------------------------------------------- | +| `prepare` | Prepares the browser for tests
`async prepare({ page, browserContext, testRunnerConfig }) {}` | +| `setup` | Executes once before all the tests run
`setup() {}` | | `preVisit` | Executes before a story is initially visited and rendered in the browser
`async preVisit(page, context) {}` | -| `postVisit` | Executes after the story is visited and fully rendered
`async postVisit(page, context) {}` | +| `postVisit` | Executes after the story is visited and fully rendered
`async postVisit(page, context) {}` |