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:
CommitSyncScript authored and Paul O’Shannessy committed 2013-06-24 16:12:06 -07:00
1 parent a62686622b
commit 7c60bb3e54
1 file changed
+8
@@ -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();