From ec4fcc0f41513167d1fbd62bce4da8af122d2fc8 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Tue, 15 Feb 2022 12:07:17 +0100 Subject: [PATCH] feat: add update snapshot command to cli --- README.md | 1 + src/util/getParsedCliOptions.ts | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 054a3c84..069aa8d2 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,7 @@ Usage: test-storybook [options] | `--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` | +| `-u`, `--updateSnapshot` | Use this flag to re-record every snapshot that fails during this test run
`test-storybook -u` | ## Configuration diff --git a/src/util/getParsedCliOptions.ts b/src/util/getParsedCliOptions.ts index 888ad0db..69ee36a9 100644 --- a/src/util/getParsedCliOptions.ts +++ b/src/util/getParsedCliOptions.ts @@ -11,7 +11,11 @@ export const getParsedCliOptions = () => { ) .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'); + .option('--verbose', 'Display individual test results with the test suite hierarchy') + .option( + '-u, --updateSnapshot', + 'Use this flag to re-record every snapshot that fails during this test run' + ); program.exitOverride();