Skip to content

Commit

Permalink
Separate storyshots (#155)
Browse files Browse the repository at this point in the history
* Add editorconfig

* Load custom babelrc in web storybook

* Separate storyshots

* Fix permission for CI
  • Loading branch information
cjies authored and 0xycvv committed Jun 7, 2018
1 parent fe9e2f7 commit 51b631f
Show file tree
Hide file tree
Showing 28 changed files with 15,219 additions and 61,844 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
name: Install Dependencies
command: |
sudo npm install -g yarn
yarn config set cache-folder .yarn-cache
yarn install --pure-lockfile
sudo yarn config set cache-folder .yarn-cache
sudo yarn install --pure-lockfile
- run: yarn cache dir
- save_cache:
key: yarn-cache-{{ checksum "yarn.lock" }}
Expand Down
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
insert_final_newline = true
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,8 @@
]
}
}
},
"env": {
"jest": true
}
}
3 changes: 3 additions & 0 deletions packages/web/.storybook/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../../.babelrc"
}
19 changes: 19 additions & 0 deletions packages/web/.storybook/storyshots.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* eslint-disable import/no-extraneous-dependencies */

import initStoryshots, {
multiSnapshotWithOptions,
} from '@storybook/addon-storyshots';
import 'jest-styled-components'

/**
* Mock methods of addon-info so that "Show Info" button don't go into snapshots.
* https://github.com/storybooks/storybook/issues/1011#issuecomment-322698049
*/
jest.mock('@storybook/addon-info', () => ({
withInfo: () => storyFn => storyFn,
setDefaults: () => {},
}));

initStoryshots({
test: multiSnapshotWithOptions({})
});
Loading

0 comments on commit 51b631f

Please sign in to comment.