-
-
Notifications
You must be signed in to change notification settings - Fork 768
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
sinon stub- cannot stub arrow function in a class #1136
Comments
This is food for the upcoming new documentation site where we hope to publish some more tutorial oriented articles on stubbing, spying, etc in the context of ES2015. Generally when you come across issues like this it is very helpful in remembering one simple fact: ES2015 is often just syntactic sugar on top of simple ES5 constructs. Meaning, when you don't understand why something happens (or doesn't happen), try deconstructing the code into its ES5 equivalent. The simplest way (which is what I just did) is to just paste the example code into the Babel playground and see what the ES2015/ES6 code compiles into:
|
What did you expect to happen?
I expected to be able to stub an arrow function in a class.
What actually happens
I can't stub an arrow function, however, I can stub the class prototype function.
How to reproduce
The text was updated successfully, but these errors were encountered: