DEV Community

Discussion on: Testing TypeScript with Mocha and Chai

Collapse
 
geoffcapper profile image
Geoff

Thanks, this got me up and running with my TS tests. Mocha recommends against using arrow functions for tests (mochajs.org/#arrow-functions). As I'm only new at this, is there a reason to use them in this context?

Collapse
 
daniel_werner profile image
Daniel Werner

Thanks for your note! You are right, it is discouraged to use arrow functions in Mocha, however if you don't need to access the Mocha context (aka this), it works fine.
No special reason to use them here, just a shorter syntax :-)