Skip to content

Commit 645434b

Browse files
Merge branch 'release/1.1.1'
2 parents 0dbda73 + 71ce6c4 commit 645434b

7 files changed

+53
-158
lines changed

.npmignore

-138
This file was deleted.

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![Build Status](https://travis-ci.org/wimpyprogrammer/react-component-update.svg?branch=master)](https://travis-ci.org/wimpyprogrammer/react-component-update)
44
[![codecov](https://codecov.io/gh/wimpyprogrammer/react-component-update/branch/master/graph/badge.svg)](https://codecov.io/gh/wimpyprogrammer/react-component-update)
55
[![Known Vulnerabilities](https://snyk.io/test/github/wimpyprogrammer/react-component-update/badge.svg)](https://snyk.io/test/github/wimpyprogrammer/react-component-update)
6+
[![Greenkeeper badge](https://badges.greenkeeper.io/wimpyprogrammer/react-component-update.svg)](https://greenkeeper.io/)
67

78
Adds convenience lifecycle events to your React components.
89

package.json

+18-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
22
"name": "react-component-update",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "Extends the native React Component to streamline updates",
55
"main": "lib/index.js",
6+
"files": [
7+
"lib/**/!(*.spec).js"
8+
],
69
"scripts": {
710
"clean": "rimraf lib",
811
"build": "npm run clean && babel src --out-dir lib",
@@ -24,29 +27,29 @@
2427
"homepage": "https://github.com/wimpyprogrammer/react-component-update#readme",
2528
"devDependencies": {
2629
"babel-cli": "^6.26.0",
27-
"babel-jest": "^20.0.3",
30+
"babel-jest": "^21.2.0",
2831
"babel-plugin-transform-object-rest-spread": "^6.26.0",
2932
"babel-preset-es2015": "^6.24.1",
3033
"babel-preset-react": "^6.24.1",
3134
"chai": "^4.0.2",
32-
"codecov": "^2.3.0",
35+
"codecov": "^3.0.0",
3336
"create-react-class": "^15.6.0",
3437
"dirty-chai": "^2.0.0",
3538
"enzyme": "^3.1.0",
3639
"enzyme-adapter-react-16": "^1.0.1",
37-
"eslint": "^3.19.0",
38-
"eslint-config-airbnb": "^15.0.1",
40+
"eslint": "^4.12.1",
41+
"eslint-config-airbnb": "^16.1.0",
3942
"eslint-plugin-import": "^2.3.0",
40-
"eslint-plugin-jsx-a11y": "^5.0.3",
43+
"eslint-plugin-jsx-a11y": "^6.0.2",
4144
"eslint-plugin-react": "^7.1.0",
42-
"jest": "^20.0.4",
45+
"jest": "^21.2.1",
4346
"lodash.uniqueid": "^4.0.1",
4447
"publish-please": "^2.3.1",
4548
"react": "*",
4649
"react-dom": "*",
4750
"react-test-renderer": "*",
4851
"rimraf": "^2.6.1",
49-
"sinon": "^3.2.1",
52+
"sinon": "^4.1.2",
5053
"sinon-chai": "^2.13.0"
5154
},
5255
"peerDependencies": {
@@ -55,7 +58,13 @@
5558
"jest": {
5659
"coverageDirectory": "./coverage/",
5760
"collectCoverage": true,
58-
"setupTestFrameworkScriptFile": "<rootDir>/test-setup.js",
61+
"collectCoverageFrom": [
62+
"src/**/!(*.spec).js"
63+
],
64+
"setupFiles": [
65+
"<rootDir>/test-shims.js",
66+
"<rootDir>/test-setup.js"
67+
],
5968
"testMatch": [
6069
"**/src/*.spec.js?(x)"
6170
]

src/component.spec.js

+15-5
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,9 @@ describe('Component extension with overrides calling super()', () => {
232232

233233
it('runs user code in override on mount', () => {
234234
sinon.assert.callOrder(
235-
userComponentWillMountBefore, callbackWill, userComponentWillMountAfter,
235+
userComponentWillMountBefore,
236+
callbackWill,
237+
userComponentWillMountAfter,
236238
);
237239
});
238240

@@ -244,7 +246,9 @@ describe('Component extension with overrides calling super()', () => {
244246
it('runs user code in override on props update', () => {
245247
component.setProps(getUniqueProps());
246248
sinon.assert.callOrder(
247-
userComponentWillReceivePropsBefore, callbackWill, userComponentWillReceivePropsAfter,
249+
userComponentWillReceivePropsBefore,
250+
callbackWill,
251+
userComponentWillReceivePropsAfter,
248252
);
249253
});
250254

@@ -261,7 +265,9 @@ describe('Component extension with overrides calling super()', () => {
261265

262266
it('runs user code in override on mount', () => {
263267
sinon.assert.callOrder(
264-
userComponentDidMountBefore, callbackDid, userComponentDidMountAfter,
268+
userComponentDidMountBefore,
269+
callbackDid,
270+
userComponentDidMountAfter,
265271
);
266272
});
267273

@@ -273,7 +279,9 @@ describe('Component extension with overrides calling super()', () => {
273279
it('runs user code in override on props update', () => {
274280
component.setProps(getUniqueProps());
275281
sinon.assert.callOrder(
276-
userComponentDidUpdateBefore, callbackDid, userComponentDidUpdateAfter,
282+
userComponentDidUpdateBefore,
283+
callbackDid,
284+
userComponentDidUpdateAfter,
277285
);
278286
});
279287

@@ -285,7 +293,9 @@ describe('Component extension with overrides calling super()', () => {
285293
it('runs user code in override on state update', () => {
286294
component.setState(getUniqueState());
287295
sinon.assert.callOrder(
288-
userComponentDidUpdateBefore, callbackDid, userComponentDidUpdateAfter,
296+
userComponentDidUpdateBefore,
297+
callbackDid,
298+
userComponentDidUpdateAfter,
289299
);
290300
});
291301
});

src/pureComponent.spec.js

+15-5
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,9 @@ descriptor('PureComponent extension with overrides calling super()', () => {
227227

228228
it('runs user code in override on mount', () => {
229229
sinon.assert.callOrder(
230-
userComponentWillMountBefore, callbackWill, userComponentWillMountAfter,
230+
userComponentWillMountBefore,
231+
callbackWill,
232+
userComponentWillMountAfter,
231233
);
232234
});
233235

@@ -239,7 +241,9 @@ descriptor('PureComponent extension with overrides calling super()', () => {
239241
it('runs user code in override on props update', () => {
240242
component.setProps(getUniqueProps());
241243
sinon.assert.callOrder(
242-
userComponentWillReceivePropsBefore, callbackWill, userComponentWillReceivePropsAfter,
244+
userComponentWillReceivePropsBefore,
245+
callbackWill,
246+
userComponentWillReceivePropsAfter,
243247
);
244248
});
245249

@@ -256,7 +260,9 @@ descriptor('PureComponent extension with overrides calling super()', () => {
256260

257261
it('runs user code in override on mount', () => {
258262
sinon.assert.callOrder(
259-
userComponentDidMountBefore, callbackDid, userComponentDidMountAfter,
263+
userComponentDidMountBefore,
264+
callbackDid,
265+
userComponentDidMountAfter,
260266
);
261267
});
262268

@@ -268,7 +274,9 @@ descriptor('PureComponent extension with overrides calling super()', () => {
268274
it('runs user code in override on props update', () => {
269275
component.setProps(getUniqueProps());
270276
sinon.assert.callOrder(
271-
userComponentDidUpdateBefore, callbackDid, userComponentDidUpdateAfter,
277+
userComponentDidUpdateBefore,
278+
callbackDid,
279+
userComponentDidUpdateAfter,
272280
);
273281
});
274282

@@ -280,7 +288,9 @@ descriptor('PureComponent extension with overrides calling super()', () => {
280288
it('runs user code in override on state update', () => {
281289
component.setState(getUniqueState());
282290
sinon.assert.callOrder(
283-
userComponentDidUpdateBefore, callbackDid, userComponentDidUpdateAfter,
291+
userComponentDidUpdateBefore,
292+
callbackDid,
293+
userComponentDidUpdateAfter,
284294
);
285295
});
286296
});

test-setup.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable global-require, import/no-extraneous-dependencies, import/no-unresolved */
2-
const configure = require('enzyme').configure;
2+
const { configure } = require('enzyme');
33
const reactVersion = require('react').version;
44

55
const [majorReactVersion, minorReactVersion] = reactVersion.split('.');

test-shims.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
global.requestAnimationFrame = (callback) => {
2+
setTimeout(callback, 0);
3+
};

0 commit comments

Comments
 (0)