From 4495623487236d1cad3fd4ee40467908d7858c31 Mon Sep 17 00:00:00 2001 From: Sebastian Andil Date: Fri, 25 Oct 2019 09:27:36 +0200 Subject: [PATCH 1/2] Update storybook 5.* configuration The config can be simplified as seen in https://storybook.js.org/docs/guides/guide-react/#step-3-create-the-config-file --- docs/docs/visual-testing-with-storybook.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/docs/visual-testing-with-storybook.md b/docs/docs/visual-testing-with-storybook.md index 07a73bebed8e1..e85b714308c87 100644 --- a/docs/docs/visual-testing-with-storybook.md +++ b/docs/docs/visual-testing-with-storybook.md @@ -36,10 +36,7 @@ import { action } from "@storybook/addon-actions" // automatically import all files ending in *.stories.js // highlight-next-line -const req = require.context("../src", true, /.stories.js$/) -function loadStories() { - req.keys().forEach(filename => req(filename)) -} +configure(require.context('../src', true, /\.stories\.js$/), module) // highlight-start // Gatsby's Link overrides: @@ -56,8 +53,6 @@ global.__PATH_PREFIX__ = "" window.___navigate = pathname => { action("NavigateTo:")(pathname) } - -configure(loadStories, module) // highlight-end ``` From 482b1566f4410fee07443ffa6a4574a06a3eeaca Mon Sep 17 00:00:00 2001 From: gatsbybot Date: Fri, 25 Oct 2019 10:57:06 +0000 Subject: [PATCH 2/2] chore: format --- docs/docs/visual-testing-with-storybook.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/visual-testing-with-storybook.md b/docs/docs/visual-testing-with-storybook.md index e85b714308c87..3ef595934410f 100644 --- a/docs/docs/visual-testing-with-storybook.md +++ b/docs/docs/visual-testing-with-storybook.md @@ -36,7 +36,7 @@ import { action } from "@storybook/addon-actions" // automatically import all files ending in *.stories.js // highlight-next-line -configure(require.context('../src', true, /\.stories\.js$/), module) +configure(require.context("../src", true, /\.stories\.js$/), module) // highlight-start // Gatsby's Link overrides: