Skip to content

Commit

Permalink
Set up testing (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
eminguyen authored Aug 8, 2019
1 parent c1e79e8 commit 625489a
Show file tree
Hide file tree
Showing 6 changed files with 672 additions and 11 deletions.
12 changes: 12 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current',
},
},
],
],
};
5 changes: 5 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
setupFiles: [
'<rootDir>/tests/setup/setupTests.js',
]
};
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"test": "jest",
"test:watch": "jest --watch",
"eject": "react-scripts eject"
},
"eslintConfig": {
Expand All @@ -37,9 +38,16 @@
]
},
"devDependencies": {
"@babel/core": "^7.5.5",
"@babel/preset-env": "^7.5.5",
"babel-jest": "^24.8.0",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",
"enzyme-to-json": "^3.4.0",
"husky": "^3.0.1",
"lint-staged": "^9.2.0",
"prettier": "^1.18.2"
"prettier": "^1.18.2",
"redux-mock-store": "^1.5.3"
},
"husky": {
"hooks": {
Expand Down
4 changes: 4 additions & 0 deletions tests/setup/setupTests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Adapter from 'enzyme-adapter-react-16';
import { configure } from 'enzyme';

configure({ adapter: new Adapter() });
13 changes: 13 additions & 0 deletions tests/setup/tests.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* TODO - Delete this file.
* This temporary test file is only here for the purpose of showcasing testing.
* It will be deleted once the first test file is created.
*/

import Jest from 'jest';

describe('Jest Tests', () => {
test('Verify Tests Work', () => {
expect(true).toBeTruthy();
});
});
Loading

0 comments on commit 625489a

Please sign in to comment.