Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import jsdomify from "jsdomify";
- var React,
- TestUtils,
- Sanity;
- describe.only("sanity", () => {
- before(() => {
- jsdomify.create();
- });
- after(() => {
- jsdomify.destroy();
- });
- beforeEach(() => {
- jsdomify.clear();
- React = require("react");
- TestUtils = require("react-addons-test-utils");
- });
- // this test passes.
- it("lets me render to the dom", () => {
- class Test extends React.Component {
- render() {
- return <div>test</div>;
- }
- }
- /* console.log(instance);
- *
- { '$$typeof': Symbol(react.element),
- type: [Function: Test],
- key: null,
- ref: null,
- props: {},
- _owner: null,
- _store: {} }
- */
- let instance = <Test />;
- TestUtils.renderIntoDocument(instance);
- });
- // this test fails.
- it("lets me render required components to the dom", () => {
- Sanity = require("./Sanity");
- let instance = <Sanity />;
- /* console.log(instance);
- *
- { '$$typeof': Symbol(react.element),
- type: { default: [Function: Sanity] },
- key: null,
- ref: null,
- props: {},
- _owner: null,
- _store: {} }
- */
- TestUtils.renderIntoDocument(instance);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement