diff --git a/karma.config.js b/karma.config.js index c224fafb..2f2c234d 100644 --- a/karma.config.js +++ b/karma.config.js @@ -1,6 +1,6 @@ -var webpack = require('webpack') +const webpack = require('webpack') -var testEntry = 'tests.webpack.js' +const testEntry = 'tests.webpack.js' module.exports = function (config) { config.set({ @@ -30,6 +30,13 @@ module.exports = function (config) { singleRun: true, webpack: { devtool: 'inline-source-map', + // required by 'enzyme' + externals: { + 'cheerio': 'window', + 'react/addons': true, + 'react/lib/ExecutionEnvironment': true, + 'react/lib/ReactContext': true + }, module: { loaders: [ { diff --git a/package.json b/package.json index f09f87d4..995e874d 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "babel-preset-react": "^6.5.0", "babel-preset-stage-1": "^6.5.0", "del-cli": "^0.2.0", + "enzyme": "^2.3.0", "eslint": "^2.12.0", "eslint-config-standard": "^5.3.1", "eslint-config-standard-react": "^2.4.0",