Skip to content

Commit aa73937

Browse files
committed
Merge branch 'develop'
Signed-off-by: carloluis <[email protected]>
2 parents 3aec110 + e805992 commit aa73937

File tree

13 files changed

+1843
-1242
lines changed

13 files changed

+1843
-1242
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![GitHub release](https://img.shields.io/github/release/uruit/react-seed.svg)](https://github.com/UruIT/react-seed/releases)
77
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md#pull-requests)
88
[![Twitter Follow](https://img.shields.io/twitter/follow/uruit.svg?style=social&label=Follow)](https://twitter.com/UruIT/followers)
9-
[![Twitter URL](https://img.shields.io/twitter/url/http/uruit.react-seed.svg?style=social)](https://twitter.com/intent/tweet?text=react-seed%20by%20%40UruIT%20on&url=https%3A%2F%2Fgithub.com%2Furuit%2Freact-seed)
9+
[![Twitter URL](https://img.shields.io/twitter/url/http/uruit.react-seed.svg?style=social)](https://twitter.com/intent/tweet?text=react-seed%20by%20%40UruIT%20on&url=https%3A%2F%2Fgithub.com%2Furuit%2Freact-seed&hashtags=react,uruit,dev,seed)
1010

1111
[![DevDependencies](https://img.shields.io/david/dev/uruit/react-seed.svg)](https://github.com/uruit/react-seed/blob/master/package.json)
1212

@@ -19,7 +19,7 @@ UruIT seed project for ReactJS applications
1919
* Webpack
2020
* ES6/7
2121
* ESLint
22-
* React
22+
* React 16
2323
* Fetch
2424
* React-Router
2525
* Jest

client/__setup__/enzyme.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import './shim';
2+
import Enzyme from 'enzyme';
3+
import Adapter from 'enzyme-adapter-react-16';
4+
5+
Enzyme.configure({ adapter: new Adapter() });

client/__setup__/shim.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const raf = (global.requestAnimationFrame = cb => setTimeout(cb, 0));
2+
3+
export default raf;

client/components/app/App.spec.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import React from 'react';
2-
import { shallow, mount } from 'enzyme';
32
import ShallowRenderer from 'react-test-renderer/shallow';
3+
import { shallow, mount } from 'enzyme';
4+
45
import { getJson } from 'utils/fetch';
56
import Clickable from '../clickable';
6-
import App from './App';
77
import links from '../../routes/links';
8+
import App from './App';
89

910
jest.mock('utils/fetch', () => ({
1011
getJson: jest.fn(url => new Promise((resolve, reject) => (url ? resolve({ value: 'another joke' }) : reject())))

client/components/app/__snapshots__/App.spec.js.snap

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ exports[`<App/> snapshot 1`] = `
1212
</button>
1313
<div
1414
className="jokes"
15-
>
16-
17-
</div>
15+
/>
1816
<Clickable
1917
content={
2018
<div

client/components/clickable/Clickable.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import styles from './clickable.scss';
55

66
const Clickable = ({ content, onClick }) => (
77
<div className={styles.container} onClick={onClick}>
8-
{ content }
8+
{content}
99
</div>
1010
);
1111

client/components/clickable/Clickable.spec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import React from 'react';
2-
import Clickable from './Clickable';
32
import renderer from 'react-test-renderer';
43
import { shallow } from 'enzyme';
54

5+
import Clickable from './Clickable';
6+
67
describe('<Clickable/>', () => {
78
it('snapshot - default props', () => {
89
const tree = renderer.create(<Clickable />).toJSON();

client/components/counter/Counter.spec.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import ShallowRenderer from 'react-test-renderer/shallow';
33
import { shallow } from 'enzyme';
4+
45
import Counter from './Counter';
56

67
describe('<Counter/>', () => {

client/components/counter/__snapshots__/Counter.spec.js.snap

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ exports[`<Counter/> snapshot 1`] = `
66
>
77
<div
88
className="value"
9-
/>
9+
>
10+
0
11+
</div>
1012
<div
1113
className="controls"
1214
>

client/package.json

+10-5
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,17 @@
1717
"dependencies": {
1818
"es6-promise": "^4.1.1",
1919
"prop-types": "^15.5.9",
20-
"react": "^15.5.4",
21-
"react-dom": "^15.5.4",
20+
"react": "^16.1.1",
21+
"react-dom": "^16.1.1",
2222
"react-router-dom": "^4.2.0",
2323
"whatwg-fetch": "^2.0.3"
2424
},
2525
"devDependencies": {
2626
"babel-preset-react-hmre": "^1.1.1",
27-
"enzyme": "^2.9.1",
28-
"jest": "^20.0.0",
29-
"react-test-renderer": "^15.6.1"
27+
"enzyme": "^3.2.0",
28+
"enzyme-adapter-react-16": "^1.1.0",
29+
"jest": "^21.2.1",
30+
"react-test-renderer": "^16.1.1"
3031
},
3132
"jest": {
3233
"moduleNameMapper": {
@@ -36,6 +37,10 @@
3637
"testPathIgnorePatterns": [
3738
"/node_modules/",
3839
"webpack"
40+
],
41+
"setupFiles": [
42+
"<rootDir>/__setup__/shim.js",
43+
"<rootDir>/__setup__/enzyme.js"
3944
]
4045
}
4146
}

0 commit comments

Comments
 (0)