From f629f96617020b2d82896c7b125923afc368cacd Mon Sep 17 00:00:00 2001 From: Michael Ridgway Date: Mon, 8 May 2017 18:32:52 -0700 Subject: [PATCH 1/2] Fix componentWillUnmount test case in isMounted tests and add mixin tests --- .../createReactClassIntegration-test.js | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/isomorphic/classic/__tests__/createReactClassIntegration-test.js b/src/isomorphic/classic/__tests__/createReactClassIntegration-test.js index 58d7ab0c7f9b4..1a86a191f691c 100644 --- a/src/isomorphic/classic/__tests__/createReactClassIntegration-test.js +++ b/src/isomorphic/classic/__tests__/createReactClassIntegration-test.js @@ -371,6 +371,25 @@ describe('create-react-class-integration', () => { var instance; var Component = createReactClass({ displayName: 'MyComponent', + mixins: [ + { + componentWillMount() { + this.log('mixin.componentWillMount'); + }, + componentDidMount() { + this.log('mixin.componentDidMount'); + }, + componentWillUpdate() { + this.log('mixin.componentWillUpdate'); + }, + componentDidUpdate() { + this.log('mixin.componentDidUpdate'); + }, + componentWillUnmount() { + this.log('mixin.componentWillUnmount'); + }, + }, + ], log(name) { ops.push(`${name}: ${this.isMounted()}`); }, @@ -407,13 +426,18 @@ describe('create-react-class-integration', () => { instance.log('after unmount'); expect(ops).toEqual([ 'getInitialState: false', + 'mixin.componentWillMount: false', 'componentWillMount: false', 'render: false', + 'mixin.componentDidMount: true', 'componentDidMount: true', + 'mixin.componentWillUpdate: true', 'componentWillUpdate: true', 'render: true', + 'mixin.componentDidUpdate: true', 'componentDidUpdate: true', - 'componentWillUnmount: false', + 'mixin.componentWillUnmount: true', + 'componentWillUnmount: true', 'after unmount: false', ]); From 90e3cb85bb1a7fb83ac07bc2b9b3861428ceb92b Mon Sep 17 00:00:00 2001 From: Michael Ridgway Date: Tue, 20 Jun 2017 13:52:37 -0700 Subject: [PATCH 2/2] Upgrade create-react-class to 15.6.0 --- package.json | 2 +- yarn.lock | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 6dd98d1689e98..61f378cab7272 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "coffee-script": "^1.8.0", "core-js": "^2.2.1", "coveralls": "^2.11.6", - "create-react-class": "^15.5.2", + "create-react-class": "^15.6.0", "del": "^2.0.2", "derequire": "^2.0.3", "escape-string-regexp": "^1.0.5", diff --git a/yarn.lock b/yarn.lock index a27aedc9da88a..741e26d022755 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1529,11 +1529,12 @@ create-hmac@^1.1.0, create-hmac@^1.1.2: create-hash "^1.1.0" inherits "^2.0.1" -create-react-class@^15.5.2: - version "15.5.2" - resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.5.2.tgz#6a8758348df660b88326a0e764d569f274aad681" +create-react-class@^15.6.0: + version "15.6.0" + resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.0.tgz#ab448497c26566e1e29413e883207d57cfe7bed4" dependencies: fbjs "^0.8.9" + loose-envify "^1.3.1" object-assign "^4.1.1" cross-spawn-async@^2.1.1, cross-spawn-async@^2.2.2: @@ -3245,7 +3246,7 @@ jest-matcher-utils@^19.0.0: chalk "^1.1.3" pretty-format "^19.0.0" -jest-matchers@^19.0.0, jest-matchers@^19.0.1: +jest-matchers@^19.0.0: version "19.0.0" resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-19.0.0.tgz#c74ecc6ebfec06f384767ba4d6fa4a42d6755754" dependencies: @@ -3687,7 +3688,7 @@ longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" -loose-envify@^1.0.0, loose-envify@^1.1.0: +loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" dependencies: