From e2eb51942a076c5c05e59fe58e8416770b33211e Mon Sep 17 00:00:00 2001 From: Ian Stewart Date: Wed, 8 Nov 2017 10:17:41 +0100 Subject: [PATCH] Issue #930 (#934) * Bumped react react-dom and html-react-parser version. * Bumped react and react-dom version. * Fixed all the tests. Fixes #930. --- .nycrc | 8 ++++++++ docs/package.json | 4 ++-- mocha-setup.js | 4 ++++ mocha.opts | 2 ++ package.json | 14 +++++++------- 5 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 .nycrc create mode 100644 mocha-setup.js create mode 100644 mocha.opts diff --git a/.nycrc b/.nycrc new file mode 100644 index 00000000..a10a6aa1 --- /dev/null +++ b/.nycrc @@ -0,0 +1,8 @@ +{ + "reporter": [ + "text" + ], + "exclude": [ + "test/**/*" + ] +} diff --git a/docs/package.json b/docs/package.json index aad6e1f3..dbb465a9 100644 --- a/docs/package.json +++ b/docs/package.json @@ -51,8 +51,8 @@ "prismjs": "^1.8.3", "prop-types": "^15.5.6", "radium": "^0.19.1", - "react": "^15.5.3", - "react-dom": "^15.5.3", + "react": "^16.0.0", + "react-dom": "^16.0.0", "react-jss": "^5.3.0", "react-router": "^3.0.2", "uuid": "^3.0.1" diff --git a/mocha-setup.js b/mocha-setup.js new file mode 100644 index 00000000..c855e1cb --- /dev/null +++ b/mocha-setup.js @@ -0,0 +1,4 @@ +const Adapter = require('enzyme-adapter-react-16'); +const enzyme = require('enzyme'); + +enzyme.configure({ adapter: new Adapter() }); diff --git a/mocha.opts b/mocha.opts new file mode 100644 index 00000000..7001a18a --- /dev/null +++ b/mocha.opts @@ -0,0 +1,2 @@ +--require ./mocha-setup +--compilers js:babel-core/register diff --git a/package.json b/package.json index ba815d30..8cdd1661 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "/*" ], "scripts": { - "test": "NODE_ENV=test nyc mocha --compilers js:babel-core/register test/*", - "test:watch": "NODE_ENV=test mocha --watch --compilers js:babel-core/register test/*", + "test": "NODE_ENV=test nyc mocha --opts ./mocha.opts test/*", + "test:watch": "NODE_ENV=test mocha --opts ./mocha.opts --watch test/*", "watch": "babel -d dist/ -w src/", "compile": "rimraf dist && babel -d dist/ src/", "lint": "eslint '{src,docs/src,test}/**/**/*.{js,jsx}'", @@ -43,7 +43,8 @@ "babel-preset-react": "^6.16.0", "babel-preset-stage-0": "^6.16.0", "chai": "^3.5.0", - "enzyme": "^2.7.0", + "enzyme": "^3.1.0", + "enzyme-adapter-react-16": "^1.0.3", "eslint": "^3.19.0", "eslint-config-airbnb": "^15.0.1", "eslint-plugin-import": "^2.6.1", @@ -53,10 +54,9 @@ "mocha": "^3.2.0", "nyc": "^11.3.0", "prettier": "^1.7.4", - "react": "^15.4.2", - "react-addons-test-utils": "^15.4.2", + "react": "^16.0.0", "react-docgen": "^2.19.0", - "react-dom": "^15.4.2", + "react-dom": "^16.0.0", "react-test-renderer": "^15.5.4", "rimraf": "^2.6.2", "sinon": "^1.17.7", @@ -81,7 +81,7 @@ "date-fns": "^1.27.2", "emojione": "^3.0.3", "escape-html": "^1.0.3", - "html-react-parser": "^0.3.4", + "html-react-parser": "^0.4.0", "lodash": "^4.17.4", "mobile-detect": "^1.3.6", "radium": "^0.19.0",