mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Add unit test to prevent regression
The original autobinding diff made some assumptions about how methods were called on components that had to be reverted. This diff enforces those assumptions in a test
This commit is contained in:
committed by
Paul O’Shannessy
parent
a62686622b
commit
7c60bb3e54
@@ -188,6 +188,14 @@ describe('ReactCompositeComponent', function() {
|
||||
});
|
||||
var instance = <ComponentClass />;
|
||||
|
||||
// These are controversial assertions for now, they just exist
|
||||
// because existing code depends on these assumptions.
|
||||
expect(function() {
|
||||
instance.methodToBeExplicitlyBound.bind(instance)();
|
||||
}).not.toThrow();
|
||||
expect(function() {
|
||||
instance.methodAutoBound();
|
||||
}).not.toThrow();
|
||||
expect(function() {
|
||||
instance.methodExplicitlyNotBound();
|
||||
}).not.toThrow();
|
||||
|
||||
Reference in New Issue
Block a user