diff --git a/src/core/__tests__/ReactPropTypes-test.js b/src/core/__tests__/ReactPropTypes-test.js index 7177c17f16..5bc56ee6c6 100644 --- a/src/core/__tests__/ReactPropTypes-test.js +++ b/src/core/__tests__/ReactPropTypes-test.js @@ -274,36 +274,39 @@ describe('Component Type', function() { describe('Instance Types', function() { it("should warn for invalid instances", function() { function Person() {} + var personName = Person.name || '<>'; + var dateName = Date.name || '<>'; + var regExpName = RegExp.name || '<>'; typeCheckFail( PropTypes.instanceOf(Person), false, 'Invalid prop `testProp` supplied to `testComponent`, expected ' + - 'instance of `Person`.' + 'instance of `' + personName + '`.' ); typeCheckFail( PropTypes.instanceOf(Person), {}, 'Invalid prop `testProp` supplied to `testComponent`, expected ' + - 'instance of `Person`.' + 'instance of `' + personName + '`.' ); typeCheckFail( PropTypes.instanceOf(Person), '', 'Invalid prop `testProp` supplied to `testComponent`, expected ' + - 'instance of `Person`.' + 'instance of `' + personName + '`.' ); typeCheckFail( PropTypes.instanceOf(Date), {}, 'Invalid prop `testProp` supplied to `testComponent`, expected ' + - 'instance of `Date`.' + 'instance of `' + dateName + '`.' ); typeCheckFail( PropTypes.instanceOf(RegExp), {}, 'Invalid prop `testProp` supplied to `testComponent`, expected ' + - 'instance of `RegExp`.' + 'instance of `' + regExpName + '`.' ); });