@samitouri / QOS-React-2 / commits / 9dd8ef4777

fix formatting and test for correct error

Clay Allsopp committed Sep 4, 2013 at 18:13 UTC 9dd8ef4777957138ace4c9728d15283e2c2d85e8
1 file changed +7 -6
src/core/__tests__/ReactComponentLifeCycle-test.js
+7 -6
@@ -408,7 +408,8 @@ describe('ReactComponentLifeCycle', function() {
408 .toThrow();
409 });
410
411 - it('should throw when calling setProps() on an unmounted component', function() {
411 + it('should throw when calling setProps() on an unmounted component',
412 + function() {
413 var PropsToUpdate = React.createClass({
414 render: function() {
415 return (
@@ -419,13 +420,13 @@ describe('ReactComponentLifeCycle', function() {
420 );
421 }
422 });
422 - var instance =
423 - <PropsToUpdate
424 - value="hello"
425 - />;
423 + var instance = <PropsToUpdate value="hello" />;
424 expect(function() {
425 instance.setProps({value: "goodbye"});
428 - }).toThrow();
426 + }).toThrow(
427 + 'Invariant Violation: replaceProps(...): Can only update a ' +
428 + 'mounted component.'
429 + );
430 });
431
432 it('should allow state updates in componentDidMount', function() {