mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix PropTypes test in IE10
Test Plan: Ran the test in jest, phantomjs, IE10, Chrome, and Firefox.
This commit is contained in:
@@ -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 || '<<anonymous>>';
|
||||
var dateName = Date.name || '<<anonymous>>';
|
||||
var regExpName = RegExp.name || '<<anonymous>>';
|
||||
|
||||
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 + '`.'
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user