Skip to content

Commit d3bfc45

Browse files
committed
Add Jest integration along with simple test case
As the project growths, it becomes harder to ensure that each commit does not introduce regression. One way to have at least some guarantees is to cover all code base with tests and run them on each PR. This commit adds Jest (test runner) as well as a simple test to prove it works and to set an example.
1 parent 674b5df commit d3bfc45

File tree

5 files changed

+2297
-93
lines changed

5 files changed

+2297
-93
lines changed

.eslintrc.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"extends": "airbnb",
33
"env": {
4-
"browser": true
4+
"browser": true,
5+
"jest/globals": true
56
},
67
"rules": {
78
"jsx-a11y/anchor-is-valid": ["error", {
@@ -10,5 +11,6 @@
1011
}],
1112
"react/prop-types": [0],
1213
"jsx-a11y/click-events-have-key-events": [0]
13-
}
14+
},
15+
"plugins": ["jest"]
1416
}

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ node_js:
88

99
script:
1010
- npm run lint
11+
- npm run test
1112
- npm run build
1213

1314
before_deploy:

0 commit comments

Comments
 (0)