Created
October 16, 2017 16:58
-
-
Save fczuardi/e5747e97211f03a82331a89a262affb8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": [ | |
"env", | |
"react" | |
] | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { configure } from '@storybook/react'; | |
const req = require.context("../", true, /\.story\.js$/); | |
function loadStories() { | |
req.keys().forEach(filename => req(filename)); | |
} | |
configure(loadStories, module); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from "react"; | |
const Foo = (props) => ( | |
<p>foo</p> | |
); | |
export default Foo; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { storiesOf } from '@storybook/react'; | |
import Foo from "."; | |
storiesOf('Foo', module).add('to Storybook', () => <Foo></Foo>); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yarn global add @storybook/cli | |
mkdir jest-issue | |
cd jest-issue/ | |
yarn init -y | |
yarn add -D lerna | |
node --version | |
# v8.5.0 | |
yarn --version | |
# 1.2.1 | |
yarn info lerna version | |
# 2.4.0 | |
npx lerna init --use-workspaces --independent | |
yarn add -D react react-dom | |
yarn add -D @storybook/react @storybook/addon-storyshots | |
yarn add -D jest react-test-renderer | |
yarn add -D babel babel-preset-react babel-preset-env | |
vim .babelrc | |
vim Storyshots.test.js | |
cd packages/ | |
mkdir foo | |
cd foo | |
mkdir src | |
vim src/index.js | |
vim src/index.story.js | |
cd ../../ | |
# npx start-storybook -p 6006 | |
npx jest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import initStoryshots from "@storybook/addon-storyshots"; | |
initStoryshots(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment