From d3b53e5abeef231f39afe06247bdf33161fdac7e Mon Sep 17 00:00:00 2001 From: Karl Date: Tue, 31 Oct 2017 09:24:10 +0100 Subject: [PATCH] Added React 16 to peerDependencies and upgrade enzyme (#56) --- package.json | 14 +++++++------- test/mocha.opts | 1 + test/utils/enzyme.js | 5 +++++ test/utils/rafPolyfill.js | 5 +++++ 4 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 test/utils/enzyme.js create mode 100644 test/utils/rafPolyfill.js diff --git a/package.json b/package.json index 39cdb35..a7fdd85 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,8 @@ "babelify": "^7.3.0", "brfs": "^1.4.3", "chai": "^3.5.0", - "enzyme": "^2.4.1", + "enzyme": "^3.1.0", + "enzyme-adapter-react-16": "^1.0.2", "eslint": "^1.6.0", "eslint-plugin-react": "^3.5.1", "gulp": "^3.9.0", @@ -34,22 +35,21 @@ "jsdom": "^9.8.3", "lodash": "^4.14.2", "mocha": "^3.2.0", - "react": "^0.14 || ^15.0.0-rc || ^15.0", - "react-addons-test-utils": "^15.3.1", + "react": "^0.14 || ^15.0.0-rc || ^15.0 || ^16.0", "react-component-gulp-tasks": "git+https://github.com/gor181/react-component-gulp-tasks.git", - "react-dom": "^0.14 || ^15.0.0-rc || ^15.0", + "react-dom": "^0.14 || ^15.0.0-rc || ^15.0 || ^16.0", "react-notification-system": "^0.2.7", "react-redux": "^4.4.5", "redux": "^3.5.2", "sinon": "^1.17.6" }, "dependencies": { - "prop-types": "^15.5.8", + "prop-types": "^15.6.0", "react-notification-system": "^0.2.x" }, "peerDependencies": { - "react": "^0.14 || ^15.0.0-rc || ^15.0", - "react-dom": "^0.14 || ^15.0.0-rc || ^15.0" + "react": "^0.14 || ^15.0.0-rc || ^15.0 || ^16.0", + "react-dom": "^0.14 || ^15.0.0-rc || ^15.0 || ^16.0" }, "browserify-shim": { "react": "global:React" diff --git a/test/mocha.opts b/test/mocha.opts index 7cfa710..b645feb 100644 --- a/test/mocha.opts +++ b/test/mocha.opts @@ -1,3 +1,4 @@ --compilers js:babel-register --require test/utils/dom.js +--require test/utils/enzyme.js --reporter spec diff --git a/test/utils/enzyme.js b/test/utils/enzyme.js new file mode 100644 index 0000000..927f0e0 --- /dev/null +++ b/test/utils/enzyme.js @@ -0,0 +1,5 @@ +import './rafPolyfill'; +import { configure } from 'enzyme'; +import Adapter from 'enzyme-adapter-react-16'; + +configure({ adapter: new Adapter() }); diff --git a/test/utils/rafPolyfill.js b/test/utils/rafPolyfill.js new file mode 100644 index 0000000..b89e314 --- /dev/null +++ b/test/utils/rafPolyfill.js @@ -0,0 +1,5 @@ +const raf = global.requestAnimationFrame = (cb) => { + setTimeout(cb, 0); +}; + +export default raf; \ No newline at end of file