Skip to content
This repository was archived by the owner on Jun 5, 2019. It is now read-only.

Commit 3f45f03

Browse files
committed
πŸ”¨ Cleans up the storyshots implementation
1 parent 309a140 commit 3f45f03

File tree

9 files changed

+13
-37
lines changed

9 files changed

+13
-37
lines changed

β€Ž.storybook/config.jsβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// switched to commonjs, but this should work fine with ts too
21
const { configure } = require('@storybook/react')
32

43
const req = require.context('../src', true, /story\.tsx?$/)

β€Ž.storybook/webpack.config.jsβ€Ž

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ module.exports = (config, env) => {
1111
include: path.resolve(__dirname, '..', 'src'),
1212
})
1313

14-
// i tried adding url-loader and file-loader
15-
// but that only seems to break storybooks
16-
// rather than fix storyshots
17-
1814
myConfig.resolve.extensions.unshift('.tsx')
1915
myConfig.resolve.extensions.unshift('.ts')
2016

β€Žpackage.jsonβ€Ž

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,23 +95,20 @@
9595
"coveralls": "^3.0.0",
9696
"electron": "^1.7.9",
9797
"electron-builder": "^19.45.4",
98-
"file-loader": "^1.1.5",
9998
"fuse-box": "^2.4.0",
10099
"husky": "^0.14.3",
101100
"jest": "^21.2.1",
102101
"jest-expect-contain-deep": "^1.0.1",
103102
"lint-staged": "^5.0.0",
104103
"npm-run-all": "^4.1.2",
105104
"prettier": "^1.8.2",
106-
"raf": "^3.4.0",
107105
"react-powerplug": "^0.1.2",
108106
"react-test-renderer": "^16.0.0",
109107
"ts-jest": "^21.2.1",
110108
"ts-loader": "^3.1.1",
111109
"ts-node": "^3.3.0",
112110
"tslint": "^5.8.0",
113-
"typescript": "~2.6.1",
114-
"url-loader": "^0.6.2"
111+
"typescript": "~2.6.1"
115112
},
116113
"jest": {
117114
"setupFiles": [
File renamed without changes.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* Poor man's polyfill for raf.
3+
*/
4+
5+
// @ts-ignore
6+
global.window = global
7+
window.addEventListener = () => {}
8+
window.requestAnimationFrame = () => 1

β€Žtest/setup.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// import 'raf/polyfill'
1+
import './mock-request-animation-frame'
22

33
jest.mock('electron-window-state-manager', () => {
44
return jest.fn().mockImplementation(() => ({

β€Žtest/storyshots.test.jsβ€Ž

Lines changed: 0 additions & 21 deletions
This file was deleted.

β€Žtest/storyshots.test.tsβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import initStoryshots from '@storybook/addon-storyshots'
2+
3+
initStoryshots()

β€Žyarn.lockβ€Ž

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6033,12 +6033,6 @@ radium@^0.19.0:
60336033
inline-style-prefixer "^2.0.5"
60346034
prop-types "^15.5.8"
60356035

6036-
raf@^3.4.0:
6037-
version "3.4.0"
6038-
resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.0.tgz#a28876881b4bc2ca9117d4138163ddb80f781575"
6039-
dependencies:
6040-
performance-now "^2.1.0"
6041-
60426036
ramda@^0.25.0:
60436037
version "0.25.0"
60446038
resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.25.0.tgz#8fdf68231cffa90bc2f9460390a0cb74a29b29a9"

0 commit comments

Comments
Β (0)