Skip to content
This repository was archived by the owner on Jan 4, 2018. It is now read-only.

Conversation

@michielbdejong
Copy link
Contributor

This note would have helped me to figure out what's happening. It's also a nice opportunity to evangelize and educate about ES6. :)

@danielstjules
Copy link
Contributor

Thanks again for the PR! Definitely agree that we need to document this behavior, as I can see it becoming a pretty common question. :)

Could probably be extended to mention all mocha functions? Since this would apply to TDD interface functions, as well as the other BDD functions like it and hooks like before, etc. For example, you can't do:

it('test', () => {
  this.skip();
});

@michielbdejong
Copy link
Contributor Author

I tried to keep it short and relevant to the context, right under the this.slow(); snippet. I think people can generalize once you put them on the right track. If you want to make it longer then maybe it should be moved out of the 'Dynamically Generating Tests' -> 'Test duration' section, and become its own little header?

@danielstjules
Copy link
Contributor

I like that idea :) Maybe a section on ES6?

@michielbdejong
Copy link
Contributor Author

Are there any other ES6 considerations apart from this one about arrow functions and the one that's already there, Working with Promises? (I can't think of anything that would change because of classes, for instance, or because of let/const)

@danielstjules
Copy link
Contributor

Not that I'm aware of. And sorry for the trouble!

@ianfixes
Copy link

This note would have helped me to figure out what's happening.

Me too.

@michielbdejong
Copy link
Contributor Author

Put it in its own section as suggested by reviewer, and rebased.

@danielstjules
Copy link
Contributor

Thanks!

danielstjules added a commit that referenced this pull request Dec 16, 2015
Add note about passing ES6 arrow functions
@danielstjules danielstjules merged commit 4d94b4a into mochajs:master Dec 16, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants