Skip to content

Mocha discourages arrow functions in tests #297

@wkw

Description

@wkw

Just getting started with first FJS project. Was working on initial tests this morning and ran into this while trying to increase a test's timeout:

Passing arrow functions to Mocha is discouraged.
Their lexical binding of the this value makes them unable to access the Mocha context, and statements like this.timeout(1000); will not work inside an arrow function.

https://mochajs.org/#arrow-functions

Are there any arguments for sticking with Arrow functions for generated tests?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions