Skip to content

Instantly share code, notes, and snippets.

@cimfalab
Created July 19, 2017 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cimfalab/367e6469830542faf0eac9244339adfe to your computer and use it in GitHub Desktop.
Save cimfalab/367e6469830542faf0eac9244339adfe to your computer and use it in GitHub Desktop.
__tests__/EventPluginHub-test.js
it('should prevent non-function listeners, at dispatch', () => {
var node = ReactTestUtils.renderIntoDocument(
<div onClick="not a function" />,
);
expect(function() {
ReactTestUtils.SimulateNative.click(node);
}).toThrowError(
'Expected onClick listener to be a function, instead got type string',
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment