Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PropTypes test in IE10 #1660

Merged
merged 1 commit into from
Jun 11, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/core/__tests__/ReactPropTypes-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 + '`.'
);
});

Expand Down