Skip to content

Commit 6c1641a

Browse files
committed
add and setup jest for tests
1 parent 3f18c78 commit 6c1641a

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

.babelrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"env": {
3+
"test": {
4+
"presets": [ "es2015", "react", "stage-0" ]
5+
}
6+
}
7+
}

.eslintrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"globals" : {
33
"ParallaxScrollListener": true,
4+
"test": true,
5+
"expect": true
46
},
57
"ecmaFeatures": {
68
"arrowFunctions": true,

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
"scripts": {
1111
"dev": "webpack --progress --colors --watch",
1212
"dev-server": "node ./examples/parallax-example/dist/server",
13-
"gh-pages": "NODE_ENV=production webpack --progress --colors"
13+
"gh-pages": "NODE_ENV=production webpack --progress --colors",
14+
"test": "jest"
15+
},
16+
"jest": {
17+
"modulePaths": ["<rootDir>/src/"]
1418
},
1519
"keywords": [
1620
"react",
@@ -27,17 +31,21 @@
2731
},
2832
"devDependencies": {
2933
"babel-core": "^6.23.1",
34+
"babel-jest": "^20.0.3",
3035
"babel-loader": "^6.3.2",
3136
"babel-preset-env": "^1.1.8",
37+
"babel-preset-es2015": "^6.24.1",
3238
"babel-preset-react": "^6.23.0",
3339
"babel-preset-stage-0": "^6.24.1",
3440
"cross-env": "^3.1.4",
3541
"css-loader": "^0.28.0",
3642
"express": "^4.14.1",
3743
"file-loader": "^0.11.1",
44+
"jest": "^20.0.4",
3845
"node-sass": "^4.5.0",
3946
"postcss-loader": "^1.3.3",
4047
"raw-loader": "^0.5.1",
48+
"regenerator-runtime": "^0.10.5",
4149
"sass-loader": "^6.0.3",
4250
"style-loader": "^0.16.1",
4351
"url-loader": "^0.5.8",

0 commit comments

Comments
 (0)