"use strict";
require('mock-modules')
.dontMock('EventPluginHub')
.mock('isEventSupported');
describe('EventPluginHub', function() {
var EventPluginHub;
var isEventSupported;
beforeEach(function() {
require('mock-modules').dumpCache();
EventPluginHub = require('EventPluginHub');
isEventSupported = require('isEventSupported');
isEventSupported.mockReturnValueOnce(false);
});
it("should prevent non-function listeners", function() {
expect(function() {
EventPluginHub.putListener(1, 'onClick', 'not a function');
}).toThrow(
'Invariant Violation: Expected onClick listener to be a function, ' +
'instead got type string'
);
});
});