Skip to content

Commit

Permalink
Adding backwards compatability for jasmineReact.renderComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyh committed Dec 18, 2014
1 parent 82f9afc commit 0c1d2f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/jasmine-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ var jasmineReact = {
}
};

// backwards compatability for React < 0.12
jasmineReact.renderComponent = jasmineReact.render;

// TODO: this has no automated test coverage. Add some integration tests for coverage.
afterEach(function(){
jasmineReact.removeAllSpies();
Expand Down
6 changes: 6 additions & 0 deletions test/jasmine-react-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ describe("jasmineReact", function(){

expect(returnValue.props.baz).toBe("bat");
});

it("should alias jasmineReact.renderComponent to jasmineReact.render", function(){
var returnValue = jasmineReact.renderComponent(<FooKlass baz="bat" />, document.getElementById("jasmine_content"));

expect(returnValue.props.baz).toBe("bat");
});
});

describe("render: test pollution", function(){
Expand Down

0 comments on commit 0c1d2f4

Please sign in to comment.