Skip to content

Commit

Permalink
Fixed storyshots config
Browse files Browse the repository at this point in the history
コンポーネントのストーリごとにファイルを __snapshots__
フォルダを作成するように修正
storybookjs/storybook#3483
storybookjs/storybook#887
  • Loading branch information
kotarella1110 committed Sep 11, 2018
1 parent 2928ade commit d7fe446
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ignore.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
declare module 'storybook-addon-smart-knobs';
declare module 'react-stubber';
declare module 'jest-styled-components/src/styleSheetSerializer';
declare module 'jest-specific-snapshot';
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"husky": "^1.0.0-rc.13",
"jest-specific-snapshot": "^1.0.0",
"jest-styled-components": "^6.2.0",
"lint-staged": "^7.2.0",
"prettier": "^1.13.7",
Expand Down
File renamed without changes.
13 changes: 10 additions & 3 deletions src/storyshots.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import initStoryshots from '@storybook/addon-storyshots';
import initStoryshots, {
multiSnapshotWithOptions,
} from '@storybook/addon-storyshots';
import { setStubbingMode } from 'react-stubber';
import 'jest-styled-components';
import styleSheetSerializer from 'jest-styled-components/src/styleSheetSerializer';
import { addSerializer } from 'jest-specific-snapshot';

setStubbingMode(true);

initStoryshots({});
addSerializer(styleSheetSerializer);

initStoryshots({
test: multiSnapshotWithOptions({}),
});
6 changes: 6 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6515,6 +6515,12 @@ jest-specific-snapshot@^0.5.0:
dependencies:
jest-snapshot ">=20.0.3"

jest-specific-snapshot@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/jest-specific-snapshot/-/jest-specific-snapshot-1.0.0.tgz#157c79e2534a6fea820fd475f5d17740c8f90833"
dependencies:
jest-snapshot ">=20.0.3"

jest-styled-components@^6.2.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/jest-styled-components/-/jest-styled-components-6.2.0.tgz#a8cbb39ff21a968e11a154c60b6e8c7b284595ff"
Expand Down

0 comments on commit d7fe446

Please sign in to comment.