@samitouri / QOS-React-2 / commits / cc09ed940f

classes in the tests when can

Alex Boatwright committed Oct 29, 2015 at 18:11 UTC cc09ed940fae42c428af9eded6ce42c5895ad8f1
1 file changed +5 -19
src/renderers/shared/reconciler/__tests__/ReactCompositeComponent-test.js
+5 -19
@@ -1242,17 +1242,11 @@ describe('ReactCompositeComponent', function() {
1242 });
1243
1244 it('should not overwrite mutated properties', function() {
1245 - function Moo(props) {
1246 - React.Component.call(this, props);
1245 + class Moo extends React.Component {
1246 + render() {
1247 + return <span />;
1248 + }
1249 }
1248 - Moo.prototype = Object.create(React.Component.prototype, {
1249 - constructor: {
1250 - value: Moo,
1251 - },
1252 - });
1253 - Moo.prototype.render = function() {
1254 - return <span />;
1255 - };
1250 Moo.defaultProps = { idx: 'moo' };
1251
1252 function Foo(props) {
@@ -1270,15 +1264,7 @@ describe('ReactCompositeComponent', function() {
1264 };
1265 Foo.defaultProps = { idx: 'foo' };
1266
1273 - function Bar() {
1274 - Foo.call(this);
1275 - }
1276 -
1277 - Bar.prototype = Object.create(Foo.prototype, {
1278 - constructor: {
1279 - value: Bar,
1280 - },
1281 - });
1267 + class Bar extends Foo {}
1268 Bar.defaultProps = { idx: 'bar' };
1269
1270 var moo = ReactTestUtils.renderIntoDocument(<Moo />);