From 5663289223ef0938402b434fcef16cacc76a2442 Mon Sep 17 00:00:00 2001 From: Bryan Stearns Date: Mon, 11 Mar 2019 10:31:02 -0700 Subject: [PATCH] fix(tests): Quell storybook HMR warnings (#149 by @bryanstearns) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Storybook fix for this issue https://github.com/storybooks/storybook/pull/1525 adds a warning when `storiesOf` doesn’t have a `module` parameter. The `module` parameter is necessary to enable hot-module-replacement to work right: https://github.com/storybooks/storybook/issues/2022#issuecomment-336027878 [skip ci] --- boilerplate/app/components/button/button.story.tsx | 2 +- boilerplate/app/components/checkbox/checkbox.story.tsx | 2 +- boilerplate/app/components/form-row/form-row.story.tsx | 2 +- boilerplate/app/components/header/header.story.tsx | 2 +- boilerplate/app/components/icon/icon.story.tsx | 2 +- boilerplate/app/components/switch/switch.story.tsx | 2 +- boilerplate/app/components/text-field/text-field.story.tsx | 2 +- boilerplate/app/components/text/text.story.tsx | 2 +- boilerplate/app/components/wallpaper/wallpaper.story.tsx | 2 +- templates/component.story.tsx.ejs | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/boilerplate/app/components/button/button.story.tsx b/boilerplate/app/components/button/button.story.tsx index 77cf3fbd..b7e2c46e 100644 --- a/boilerplate/app/components/button/button.story.tsx +++ b/boilerplate/app/components/button/button.story.tsx @@ -14,7 +14,7 @@ const buttonTextStyleArray: TextStyle[] = [ {color: "#a511dc"}, ] -storiesOf("Button") +storiesOf("Button", module) .addDecorator(fn => {fn()}) .add("Style Presets", () => ( diff --git a/boilerplate/app/components/checkbox/checkbox.story.tsx b/boilerplate/app/components/checkbox/checkbox.story.tsx index 5bc1d87b..2e815975 100644 --- a/boilerplate/app/components/checkbox/checkbox.story.tsx +++ b/boilerplate/app/components/checkbox/checkbox.story.tsx @@ -18,7 +18,7 @@ const arrayFillStyle: ViewStyle[] = [ {backgroundColor: "#55e0ff"}, ] -storiesOf("Checkbox") +storiesOf("Checkbox", module) .addDecorator(fn => {fn()}) .add("Behaviour", () => ( diff --git a/boilerplate/app/components/form-row/form-row.story.tsx b/boilerplate/app/components/form-row/form-row.story.tsx index 84f71b53..7ec8c0e2 100644 --- a/boilerplate/app/components/form-row/form-row.story.tsx +++ b/boilerplate/app/components/form-row/form-row.story.tsx @@ -14,7 +14,7 @@ const arrayStyle: ViewStyle[] = [ {borderColor: "#32cd32"}, ] -storiesOf("FormRow") +storiesOf("FormRow", module) .addDecorator(fn => {fn()}) .add("Assembled", () => ( diff --git a/boilerplate/app/components/header/header.story.tsx b/boilerplate/app/components/header/header.story.tsx index 6d3d8cd3..f30ce99a 100644 --- a/boilerplate/app/components/header/header.story.tsx +++ b/boilerplate/app/components/header/header.story.tsx @@ -10,7 +10,7 @@ const VIEWSTYLE = { backgroundColor: color.storybookDarkBg, } -storiesOf("Header") +storiesOf("Header", module) .addDecorator(fn => {fn()}) .add("Behavior", () => ( diff --git a/boilerplate/app/components/icon/icon.story.tsx b/boilerplate/app/components/icon/icon.story.tsx index 0de4ff2c..2f58cd22 100644 --- a/boilerplate/app/components/icon/icon.story.tsx +++ b/boilerplate/app/components/icon/icon.story.tsx @@ -3,7 +3,7 @@ import { storiesOf } from "@storybook/react-native" import { StoryScreen, Story, UseCase } from "../../../storybook/views" import { Icon } from "./icon" -storiesOf("Icon") +storiesOf("Icon", module) .addDecorator(fn => {fn()}) .add("Names", () => ( diff --git a/boilerplate/app/components/switch/switch.story.tsx b/boilerplate/app/components/switch/switch.story.tsx index 51dd2ff5..40b908aa 100644 --- a/boilerplate/app/components/switch/switch.story.tsx +++ b/boilerplate/app/components/switch/switch.story.tsx @@ -46,7 +46,7 @@ const thumbOnStyle: ViewStyle[] = [ }, ] -storiesOf("Switch") +storiesOf("Switch", module) .addDecorator(fn => {fn()}) .add("Behaviour", () => ( diff --git a/boilerplate/app/components/text-field/text-field.story.tsx b/boilerplate/app/components/text-field/text-field.story.tsx index 205ee137..ea0c1f9f 100644 --- a/boilerplate/app/components/text-field/text-field.story.tsx +++ b/boilerplate/app/components/text-field/text-field.story.tsx @@ -24,7 +24,7 @@ const inputStyleArray: TextStyle[] = [ ] var alertWhenFocused = true -storiesOf("TextField") +storiesOf("TextField", module) .addDecorator(fn => {fn()}) .add("Labelling", () => ( diff --git a/boilerplate/app/components/text/text.story.tsx b/boilerplate/app/components/text/text.story.tsx index 926f2853..ec20ee5f 100644 --- a/boilerplate/app/components/text/text.story.tsx +++ b/boilerplate/app/components/text/text.story.tsx @@ -14,7 +14,7 @@ const viewStyleArray: ViewStyle[] = [ {backgroundColor: "#7fff00"}, ] -storiesOf("Text") +storiesOf("Text", module) .addDecorator(fn => {fn()}) .add("Style Presets", () => ( diff --git a/boilerplate/app/components/wallpaper/wallpaper.story.tsx b/boilerplate/app/components/wallpaper/wallpaper.story.tsx index 2ae88849..c846aa0b 100644 --- a/boilerplate/app/components/wallpaper/wallpaper.story.tsx +++ b/boilerplate/app/components/wallpaper/wallpaper.story.tsx @@ -3,7 +3,7 @@ import { storiesOf } from "@storybook/react-native" import { StoryScreen, Story, UseCase } from "../../../storybook/views" import { Wallpaper } from "./wallpaper" -storiesOf("Wallpaper") +storiesOf("Wallpaper", module) .addDecorator(fn => {fn()}) .add("Style Presets", () => ( diff --git a/templates/component.story.tsx.ejs b/templates/component.story.tsx.ejs index ec460576..3da85a88 100644 --- a/templates/component.story.tsx.ejs +++ b/templates/component.story.tsx.ejs @@ -3,7 +3,7 @@ import { storiesOf } from "@storybook/react-native" import { StoryScreen, Story, UseCase } from "../../../storybook/views" import { <%= props.pascalName %> } from "./" -storiesOf("<%= props.pascalName %>") +storiesOf("<%= props.pascalName %>", module) .addDecorator(fn => {fn()}) .add("Style Presets", () => (