From 7cd5e9b399b32daf3f4b1c494cfb4587067360eb Mon Sep 17 00:00:00 2001 From: Ben Alpert Date: Sat, 7 Jun 2014 18:56:28 -0700 Subject: [PATCH] Fix PropTypes test in IE10 Test Plan: Ran the test in jest, phantomjs, IE10, Chrome, and Firefox. --- src/core/__tests__/ReactPropTypes-test.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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 + '`.' ); });