mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix failing tests
Two of your tests were failing because of commit
1e71df5399
I fixed them by:
1) Using jasmine's spyOn in ReactCompositeComponentError-test.js
2) Inverting the function wrapping in the above commit.
Godspeed.
This commit is contained in:
@@ -878,10 +878,10 @@ var ReactCompositeComponentMixin = {
|
||||
continue;
|
||||
}
|
||||
var method = this.__reactAutoBindMap[autoBindKey];
|
||||
this[autoBindKey] = ReactErrorUtils.guard(
|
||||
this._bindAutoBindMethod(method),
|
||||
this[autoBindKey] = this._bindAutoBindMethod(ReactErrorUtils.guard(
|
||||
method,
|
||||
this.constructor.displayName + '.' + autoBindKey
|
||||
);
|
||||
));
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -21,15 +21,12 @@
|
||||
|
||||
var React = require('React');
|
||||
var ReactTestUtils = require('ReactTestUtils');
|
||||
var ReactErrorUtils;
|
||||
var ReactErrorUtils = require('ReactErrorUtils');
|
||||
|
||||
describe('ReactCompositeComponent-error', function() {
|
||||
|
||||
beforeEach(function() {
|
||||
ReactErrorUtils = require('ReactErrorUtils');
|
||||
});
|
||||
|
||||
it('should be passed the component and method name', function() {
|
||||
spyOn(ReactErrorUtils, 'guard');
|
||||
var Component = React.createClass({
|
||||
someHandler: function() {},
|
||||
render: function() {
|
||||
@@ -37,10 +34,10 @@ describe('ReactCompositeComponent-error', function() {
|
||||
}
|
||||
});
|
||||
|
||||
var instance = <Component />;
|
||||
ReactTestUtils.renderIntoDocument(instance);
|
||||
expect(ReactErrorUtils.guard.mock.calls[0][1])
|
||||
.toEqual('Component.someHandler');
|
||||
var instance = <Component />;
|
||||
ReactTestUtils.renderIntoDocument(instance);
|
||||
expect(ReactErrorUtils.guard.mostRecentCall.args[1])
|
||||
.toEqual('Component.someHandler');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user