We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b291fe0 commit f7c6857Copy full SHA for f7c6857
utils/tester.js
@@ -0,0 +1,19 @@
1
+import jsdom from 'jsdom';
2
+import TestUtils from 'react-addons-test-utils';
3
+import React from 'react';
4
+
5
+function renderComponent(react, props) {
6
+ global.document = jsdom.jsdom('<!DOCTYPE html><html><body></body></html>');
7
+ global.window = global.document.parentWindow;
8
9
+ const rendered = TestUtils.renderIntoDocument(React.createElement(react, props));
10
11
+ return TestUtils.findRenderedComponentWithType(rendered, react);
12
+}
13
14
+export function renderJSX(jsx, context, node) {
15
+ return renderComponent(React.createClass({
16
+ displayName: 'TestJSX',
17
+ render: () => jsx,
18
+ }), undefined, context);
19
0 commit comments