Skip to content

Instantly share code, notes, and snippets.

@adamcharnock
Created January 6, 2016 09:17
Show Gist options
  • Save adamcharnock/c3c30090282410a60804 to your computer and use it in GitHub Desktop.
Save adamcharnock/c3c30090282410a60804 to your computer and use it in GitHub Desktop.

Revisions

  1. adamcharnock created this gist Jan 6, 2016.
    14 changes: 14 additions & 0 deletions component.jsx
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    import React from 'react';
    import Relay from 'react-relay';

    export default class ${NAME} extends React.Component {

    static propTypes = {};
    static defaultProps = {};

    render() {
    return (
    <div />
    );
    }
    }
    21 changes: 21 additions & 0 deletions component_test.jsx
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    import React from 'react';
    import ReactDOM from 'react-dom';
    import TestUtils from 'react/lib/ReactTestUtils';

    import ${NAME} from 'components/${NAME}';

    describe('${NAME}', () => {

    beforeEach(function() {
    });

    it('Does something', () => {
    let shallowRenderer = TestUtils.createRenderer();
    shallowRenderer.render(
    <${NAME} />
    );
    var result = shallowRenderer.getRenderOutput();
    expect(result.props.children).to.equal('Some content');
    });

    });