Skip to content

Instantly share code, notes, and snippets.

@awei01
Created April 21, 2014 23:24
Show Gist options
  • Save awei01/11159942 to your computer and use it in GitHub Desktop.
Save awei01/11159942 to your computer and use it in GitHub Desktop.
Code sample of my test that is breaking when I don't think it should.
/** @jsx React.DOM */
'use strict';
describe('sample test', function() {
var Broken, Working;
beforeEach(function() {
Broken = React.createClass({
render : function() {
return (
<div>i am broken</div>
);
}
});
Working = React.createClass({
render : function() {
return (
<div></div>
);
}
});
});
it('should render broken into document', function() {
var broken = <Broken />;
React.addons.TestUtils.renderIntoDocument(broken);
});
it('should render working into document', function() {
var working = <Working />;
React.addons.TestUtils.renderIntoDocument(working);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment