Skip to content

Commit

Permalink
πŸ”€ Merge pull request #19 from alexlee-dev/feature/coveralls
Browse files Browse the repository at this point in the history
βœ… Add setup for testing.
  • Loading branch information
Alex Lee committed Aug 19, 2019
2 parents 77fbfd2 + b7912b0 commit 68a861d
Show file tree
Hide file tree
Showing 6 changed files with 936 additions and 492 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"]
}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ node_js:
- 'node'
script:
- yarn build
- yarn coveralls
- yarn test:coveralls
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,17 @@
"redux-thunk": "^2.3.0",
"styled-components": "^4.3.2"
},
"devDependencies": {
"coveralls": "^3.0.6",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"coveralls": "echo Setup Coveralls."
"test": "react-scripts test",
"test:coveralls": "jest --coverage --collectCoverageFrom=src/**/* --coverageReporters=text-lcov | coveralls"
},
"eslintConfig": {
"extends": "react-app"
Expand Down
5 changes: 5 additions & 0 deletions src/__tests__/App.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('Fake Test', () => {
it('Should pass.', () => {
expect(1 + 1).toBe(2)
})
})
4 changes: 4 additions & 0 deletions src/setupTests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';

configure({ adapter: new Adapter() });
Loading

0 comments on commit 68a861d

Please sign in to comment.