Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kokororin committed May 21, 2017
1 parent b501df0 commit e09c31c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
8 changes: 6 additions & 2 deletions build/webpack.config.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const path = require('path');

const srcPath = path.join(__dirname, '/../src');
const webpack = require('webpack');

module.exports = {
entry: [
Expand All @@ -27,6 +26,11 @@ module.exports = {
'@': path.join(__dirname, '/../src')
}
},
plugins: [
new webpack.ProvidePlugin({
autobind: 'autobind-decorator'
})
],
externals: {
cheerio: 'window',
'react/addons': true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
"null-loader": "^0.1.1",
"open": "0.0.5",
"open-browser-webpack-plugin": "^0.0.5",
"react-addons-test-utils": "^15.0.0",
"react-hot-loader": "^v3.0.0-beta.6",
"react-test-renderer": "^15.5.4",
"rimraf": "^2.4.3",
"sass-loader": "^6.0.5",
"style-loader": "^0.17.0",
Expand Down
7 changes: 4 additions & 3 deletions test/helpers/shallowRenderHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* @author somonsmith
*/
import React from 'react';
import TestUtils from 'react-addons-test-utils';
import TestUtils from 'react-dom/test-utils';
import shallow from 'react-test-renderer/shallow';

/**
* Get the shallow rendered component
Expand All @@ -17,7 +18,7 @@ import TestUtils from 'react-addons-test-utils';
* @return {Object} Shallow rendered output
*/
export default function createComponent(component, props = {}, ...children) {
const shallowRenderer = TestUtils.createRenderer();
const shallowRenderer = shallow.createRenderer();
shallowRenderer.render(React.createElement(component, props, children.length > 1 ? children : children[0]));
return shallowRenderer.getRenderOutput();
}
}
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2494,7 +2494,7 @@ fastparse@^1.1.1:
version "1.1.1"
resolved "https://registry.npmjs.org/fastparse/-/fastparse-1.1.1.tgz#d1e2643b38a94d7583b479060e6c4affc94071f8"

fbjs@^0.8.4, fbjs@^0.8.6, fbjs@^0.8.9:
fbjs@^0.8.6, fbjs@^0.8.9:
version "0.8.12"
resolved "https://registry.npmjs.org/fbjs/-/fbjs-0.8.12.tgz#10b5d92f76d45575fd63a217d4ea02bea2f8ed04"
dependencies:
Expand Down Expand Up @@ -4989,13 +4989,6 @@ rc@^1.0.1, rc@^1.1.2, rc@^1.1.7:
minimist "^1.2.0"
strip-json-comments "~2.0.1"

react-addons-test-utils@^15.0.0:
version "15.5.1"
resolved "https://registry.npmjs.org/react-addons-test-utils/-/react-addons-test-utils-15.5.1.tgz#e0d258cda2a122ad0dff69f838260d0c3958f5f7"
dependencies:
fbjs "^0.8.4"
object-assign "^4.1.0"

react-deep-force-update@^2.0.1:
version "2.0.1"
resolved "https://registry.npmjs.org/react-deep-force-update/-/react-deep-force-update-2.0.1.tgz#4f7f6c12c3e7de42f345992a3c518236fa1ecad3"
Expand Down Expand Up @@ -5110,6 +5103,13 @@ react-tap-event-plugin@^2.0.1:
dependencies:
fbjs "^0.8.6"

react-test-renderer@^15.5.4:
version "15.5.4"
resolved "https://registry.npmjs.org/react-test-renderer/-/react-test-renderer-15.5.4.tgz#d4ebb23f613d685ea8f5390109c2d20fbf7c83bc"
dependencies:
fbjs "^0.8.9"
object-assign "^4.1.0"

react@^15.0.0:
version "15.5.4"
resolved "https://registry.npmjs.org/react/-/react-15.5.4.tgz#fa83eb01506ab237cdc1c8c3b1cea8de012bf047"
Expand Down

0 comments on commit e09c31c

Please sign in to comment.