Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
ADD Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinPy committed Oct 22, 2017
1 parent 044f373 commit c58272d
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 9 deletions.
15 changes: 15 additions & 0 deletions __tests__/components/App.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import App from '../../src/js/components/App';
import { shallow, configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';

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

test('Get h1 content', () => {
const wrapper = shallow(
<App/>
);
const expected = wrapper.find('h1').text();
const result = 'It\'s Works !';
expect(expected).toBe(result);
});
15 changes: 15 additions & 0 deletions __tests__/components/NotFound.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import NotFound from '../../src/js/components/NotFound';
import { shallow, configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';

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

test('Get h1 content', () => {
const wrapper = shallow(
<NotFound/>
);
const expected = wrapper.find('h1').text();
const result = 'Page not found !';
expect(expected).toBe(result);
});
22 changes: 15 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "iceberg-bp",
"description": "Front-End Starter for your Web Projects with React, Webpack, Babel and SASS",
"version": "2.1.2",
"version": "2.2.0",
"author": "Kevin Py",
"license": "MIT",
"repository": {
Expand All @@ -15,8 +15,6 @@
"babel-core": "^6.24.1",
"babel-eslint": "^8.0.1",
"babel-loader": "^7.0.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0",
"eslint": "^4.9.0",
Expand All @@ -34,11 +32,21 @@
"style-loader": "^0.19.0",
"webpack-dev-server": "^2.4.2"
},
"scripts": {
"build": "webpack -p",
"start": "webpack-dev-server"
},
"devDependencies": {
"babel-jest": "^21.2.0",
"babel-polyfill": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"enzyme": "^3.1.0",
"enzyme-adapter-react-16": "^1.0.2",
"jest": "^21.2.1",
"react-addons-test-utils": "^15.6.2",
"react-test-renderer": "^16.0.0",
"webpack": "^3.8.1"
},
"scripts": {
"build": "webpack -p",
"start": "webpack-dev-server",
"test": "jest --setupTestFrameworkScriptFile=raf/polyfill"
}
}
5 changes: 3 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ $ npm install
#### Scripts
`npm start` : Launch `webpack-dev-server` with Hot Module Replacement - http://localhost:8080<br />
`npm run build` : Compile **/src** folder and create **/dist** folder<br />
`npm run test` : Launch tests<br />
#### Structure
```
/src
Expand All @@ -35,7 +36,7 @@ $ npm install
|- index.js
```
#### TODO
[ ] Tests<br />
[x] Tests<br />
[x] ESLint<br />
[ ] Separate Webpack Dev/Prod<br />
[x] Router
[x] Router

0 comments on commit c58272d

Please sign in to comment.