From b44d78feee1c64dfa5e0dc21cb52f6bd88fb2a74 Mon Sep 17 00:00:00 2001 From: jonniebigodes Date: Tue, 7 May 2024 17:33:50 +0100 Subject: [PATCH] Merge pull request #27058 from storybookjs/docs_fix_storyshots_migration_guide_snippet Docs: Minor fixes to the testing snippets (cherry picked from commit 7c9db119cdf95c310f1e93b93e70b33cb40373b5) --- .../common/storybook-coverage-addon-config-options.ts.mdx | 2 +- docs/snippets/common/test-runner-image-snapshot-testing.js.mdx | 2 ++ docs/snippets/common/test-runner-waitpageready.js.mdx | 1 + docs/snippets/common/test-runner-waitpageready.ts.mdx | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/snippets/common/storybook-coverage-addon-config-options.ts.mdx b/docs/snippets/common/storybook-coverage-addon-config-options.ts.mdx index 71f5946e1da0..a2058dce0699 100644 --- a/docs/snippets/common/storybook-coverage-addon-config-options.ts.mdx +++ b/docs/snippets/common/storybook-coverage-addon-config-options.ts.mdx @@ -13,7 +13,7 @@ const coverageConfig: AddonOptionsWebpack = { istanbul: { include: ['**/stories/**'], exclude: ['**/exampleDirectory/**'], - } + }, }; const config: StorybookConfig = { diff --git a/docs/snippets/common/test-runner-image-snapshot-testing.js.mdx b/docs/snippets/common/test-runner-image-snapshot-testing.js.mdx index b08405d1505c..d3fd40334eb1 100644 --- a/docs/snippets/common/test-runner-image-snapshot-testing.js.mdx +++ b/docs/snippets/common/test-runner-image-snapshot-testing.js.mdx @@ -1,6 +1,8 @@ ```js // .storybook/test-runner.js +const { waitForPageReady } = require('@storybook/test-runner'); + const { toMatchImageSnapshot } = require('jest-image-snapshot'); const customSnapshotsDir = `${process.cwd()}/__snapshots__`; diff --git a/docs/snippets/common/test-runner-waitpageready.js.mdx b/docs/snippets/common/test-runner-waitpageready.js.mdx index 1bb3df563c00..42e1f36d3338 100644 --- a/docs/snippets/common/test-runner-waitpageready.js.mdx +++ b/docs/snippets/common/test-runner-waitpageready.js.mdx @@ -2,6 +2,7 @@ // .storybook/test-runner.js const { waitForPageReady } = require('@storybook/test-runner'); + const { toMatchImageSnapshot } = require('jest-image-snapshot'); const customSnapshotsDir = `${process.cwd()}/__snapshots__`; diff --git a/docs/snippets/common/test-runner-waitpageready.ts.mdx b/docs/snippets/common/test-runner-waitpageready.ts.mdx index 2da14b2c7185..d017273d9f96 100644 --- a/docs/snippets/common/test-runner-waitpageready.ts.mdx +++ b/docs/snippets/common/test-runner-waitpageready.ts.mdx @@ -2,6 +2,7 @@ // .storybook/test-runner.ts import type { TestRunnerConfig } from '@storybook/test-runner'; + import { waitForPageReady } from '@storybook/test-runner'; import { toMatchImageSnapshot } from 'jest-image-snapshot';