Skip to content

Commit

Permalink
Merge branch 'release/1.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
wimpyprogrammer committed Dec 2, 2017
2 parents 0dbda73 + 71ce6c4 commit 645434b
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 158 deletions.
138 changes: 0 additions & 138 deletions .npmignore

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![Build Status](https://travis-ci.org/wimpyprogrammer/react-component-update.svg?branch=master)](https://travis-ci.org/wimpyprogrammer/react-component-update)
[![codecov](https://codecov.io/gh/wimpyprogrammer/react-component-update/branch/master/graph/badge.svg)](https://codecov.io/gh/wimpyprogrammer/react-component-update)
[![Known Vulnerabilities](https://snyk.io/test/github/wimpyprogrammer/react-component-update/badge.svg)](https://snyk.io/test/github/wimpyprogrammer/react-component-update)
[![Greenkeeper badge](https://badges.greenkeeper.io/wimpyprogrammer/react-component-update.svg)](https://greenkeeper.io/)

Adds convenience lifecycle events to your React components.

Expand Down
27 changes: 18 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"name": "react-component-update",
"version": "1.1.0",
"version": "1.1.1",
"description": "Extends the native React Component to streamline updates",
"main": "lib/index.js",
"files": [
"lib/**/!(*.spec).js"
],
"scripts": {
"clean": "rimraf lib",
"build": "npm run clean && babel src --out-dir lib",
Expand All @@ -24,29 +27,29 @@
"homepage": "https://github.com/wimpyprogrammer/react-component-update#readme",
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-jest": "^20.0.3",
"babel-jest": "^21.2.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"chai": "^4.0.2",
"codecov": "^2.3.0",
"codecov": "^3.0.0",
"create-react-class": "^15.6.0",
"dirty-chai": "^2.0.0",
"enzyme": "^3.1.0",
"enzyme-adapter-react-16": "^1.0.1",
"eslint": "^3.19.0",
"eslint-config-airbnb": "^15.0.1",
"eslint": "^4.12.1",
"eslint-config-airbnb": "^16.1.0",
"eslint-plugin-import": "^2.3.0",
"eslint-plugin-jsx-a11y": "^5.0.3",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-react": "^7.1.0",
"jest": "^20.0.4",
"jest": "^21.2.1",
"lodash.uniqueid": "^4.0.1",
"publish-please": "^2.3.1",
"react": "*",
"react-dom": "*",
"react-test-renderer": "*",
"rimraf": "^2.6.1",
"sinon": "^3.2.1",
"sinon": "^4.1.2",
"sinon-chai": "^2.13.0"
},
"peerDependencies": {
Expand All @@ -55,7 +58,13 @@
"jest": {
"coverageDirectory": "./coverage/",
"collectCoverage": true,
"setupTestFrameworkScriptFile": "<rootDir>/test-setup.js",
"collectCoverageFrom": [
"src/**/!(*.spec).js"
],
"setupFiles": [
"<rootDir>/test-shims.js",
"<rootDir>/test-setup.js"
],
"testMatch": [
"**/src/*.spec.js?(x)"
]
Expand Down
20 changes: 15 additions & 5 deletions src/component.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ describe('Component extension with overrides calling super()', () => {

it('runs user code in override on mount', () => {
sinon.assert.callOrder(
userComponentWillMountBefore, callbackWill, userComponentWillMountAfter,
userComponentWillMountBefore,
callbackWill,
userComponentWillMountAfter,
);
});

Expand All @@ -244,7 +246,9 @@ describe('Component extension with overrides calling super()', () => {
it('runs user code in override on props update', () => {
component.setProps(getUniqueProps());
sinon.assert.callOrder(
userComponentWillReceivePropsBefore, callbackWill, userComponentWillReceivePropsAfter,
userComponentWillReceivePropsBefore,
callbackWill,
userComponentWillReceivePropsAfter,
);
});

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

it('runs user code in override on mount', () => {
sinon.assert.callOrder(
userComponentDidMountBefore, callbackDid, userComponentDidMountAfter,
userComponentDidMountBefore,
callbackDid,
userComponentDidMountAfter,
);
});

Expand All @@ -273,7 +279,9 @@ describe('Component extension with overrides calling super()', () => {
it('runs user code in override on props update', () => {
component.setProps(getUniqueProps());
sinon.assert.callOrder(
userComponentDidUpdateBefore, callbackDid, userComponentDidUpdateAfter,
userComponentDidUpdateBefore,
callbackDid,
userComponentDidUpdateAfter,
);
});

Expand All @@ -285,7 +293,9 @@ describe('Component extension with overrides calling super()', () => {
it('runs user code in override on state update', () => {
component.setState(getUniqueState());
sinon.assert.callOrder(
userComponentDidUpdateBefore, callbackDid, userComponentDidUpdateAfter,
userComponentDidUpdateBefore,
callbackDid,
userComponentDidUpdateAfter,
);
});
});
Expand Down
20 changes: 15 additions & 5 deletions src/pureComponent.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ descriptor('PureComponent extension with overrides calling super()', () => {

it('runs user code in override on mount', () => {
sinon.assert.callOrder(
userComponentWillMountBefore, callbackWill, userComponentWillMountAfter,
userComponentWillMountBefore,
callbackWill,
userComponentWillMountAfter,
);
});

Expand All @@ -239,7 +241,9 @@ descriptor('PureComponent extension with overrides calling super()', () => {
it('runs user code in override on props update', () => {
component.setProps(getUniqueProps());
sinon.assert.callOrder(
userComponentWillReceivePropsBefore, callbackWill, userComponentWillReceivePropsAfter,
userComponentWillReceivePropsBefore,
callbackWill,
userComponentWillReceivePropsAfter,
);
});

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

it('runs user code in override on mount', () => {
sinon.assert.callOrder(
userComponentDidMountBefore, callbackDid, userComponentDidMountAfter,
userComponentDidMountBefore,
callbackDid,
userComponentDidMountAfter,
);
});

Expand All @@ -268,7 +274,9 @@ descriptor('PureComponent extension with overrides calling super()', () => {
it('runs user code in override on props update', () => {
component.setProps(getUniqueProps());
sinon.assert.callOrder(
userComponentDidUpdateBefore, callbackDid, userComponentDidUpdateAfter,
userComponentDidUpdateBefore,
callbackDid,
userComponentDidUpdateAfter,
);
});

Expand All @@ -280,7 +288,9 @@ descriptor('PureComponent extension with overrides calling super()', () => {
it('runs user code in override on state update', () => {
component.setState(getUniqueState());
sinon.assert.callOrder(
userComponentDidUpdateBefore, callbackDid, userComponentDidUpdateAfter,
userComponentDidUpdateBefore,
callbackDid,
userComponentDidUpdateAfter,
);
});
});
Expand Down
2 changes: 1 addition & 1 deletion test-setup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable global-require, import/no-extraneous-dependencies, import/no-unresolved */
const configure = require('enzyme').configure;
const { configure } = require('enzyme');
const reactVersion = require('react').version;

const [majorReactVersion, minorReactVersion] = reactVersion.split('.');
Expand Down
3 changes: 3 additions & 0 deletions test-shims.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
global.requestAnimationFrame = (callback) => {
setTimeout(callback, 0);
};

0 comments on commit 645434b

Please sign in to comment.