Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error if you try to simulate a non-existing event #79

Closed
tmcw opened this issue Dec 18, 2015 · 0 comments
Closed

Better error if you try to simulate a non-existing event #79

tmcw opened this issue Dec 18, 2015 · 0 comments

Comments

@tmcw
Copy link
Contributor

tmcw commented Dec 18, 2015

Running

input.simulate('keyDown', { which: val });

Produces

TypeError: Cannot read property 'apply' of undefined
      at ReactWrapper.<anonymous> (node_modules/enzyme/build/ReactWrapper.js:351:44)
      at ReactWrapper.single (node_modules/enzyme/build/ReactWrapper.js:739:17)
      at ReactWrapper.simulate (node_modules/enzyme/build/ReactWrapper.js:350:12)

Because there's an unchecked reference to an event type. Instead, enzyme should give an informative message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants