Skip to content

Mocha tests: Missing function expression name. (func-names) #433

Description

@olalonde

When writing Mocha tests, it is not possible to use fat arrow functions because we sometimes need to use the this keyword to change the test's timeout for example.

describe('some description', function () {
  before('blabla', function () {
    this.timeout(10000);
    return somePromise();
  });
});

This results in the following eslint error:

Missing function expression name. (func-names)

I was wondering what was the guidelines for this case. Naming the functions is out of the question as it would add a lot of noise.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions