From 183f9c3ebe3d6fc0bcda295c14b73b22c829ba69 Mon Sep 17 00:00:00 2001 From: Alexei Zaviruha Date: Mon, 26 Jun 2017 13:46:35 +0300 Subject: [PATCH] Fix test-runner config for modern react and enzyme. See https://github.com/airbnb/enzyme/blob/master/docs/guides/webpack.md\#webpack-2 --- karma.conf.js | 8 +++----- yarn.lock | 4 ++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index ca992ca..e12c1bb 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -44,11 +44,9 @@ module.exports = function (config) { }, externals: { cheerio: 'window', - 'react/addons': true, - 'react/lib/ExecutionEnvironment': true, - 'react/lib/ReactContext': true, - 'react-dom/test-utils': true, - 'react-test-renderer/shallow': true + 'react/addons': 'react', + 'react/lib/ExecutionEnvironment': 'react', + 'react/lib/ReactContext': 'react' } }, diff --git a/yarn.lock b/yarn.lock index 6ad1b1e..42b1d98 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4179,6 +4179,10 @@ rc@^1.0.1, rc@^1.1.6, rc@^1.1.7: minimist "^1.2.0" strip-json-comments "~2.0.1" +react-addons-test-utils@^15.6.0: + version "15.6.0" + resolved "https://registry.yarnpkg.com/react-addons-test-utils/-/react-addons-test-utils-15.6.0.tgz#062d36117fe8d18f3ba5e06eb33383b0b85ea5b9" + react-dom@^15.6.1: version "15.6.1" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.6.1.tgz#2cb0ed4191038e53c209eb3a79a23e2a4cf99470"