Skip to content

Switch tests from arrow functions #200

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

Closed
kadler opened this issue Mar 27, 2020 · 3 comments · Fixed by #283
Closed

Switch tests from arrow functions #200

kadler opened this issue Mar 27, 2020 · 3 comments · Fixed by #283
Labels
enhancement New feature or request keep-open Exempts stale action from auto closing the issue/pr. stale
Milestone

Comments

@kadler
Copy link
Member

kadler commented Mar 27, 2020

Mocha recommends against arrow functions as it prevents access to the Mocha context: https://mochajs.org/#arrow-functions

This prevents us from setting timeouts (#198) or slow time (#199).

@kadler kadler added the enhancement New feature or request label Mar 27, 2020
@kadler kadler added this to the Version 1.1 milestone Mar 27, 2020
@abmusse
Copy link
Member

abmusse commented Mar 27, 2020

I think part of the reason we used arrow functions is because the linter prefers arrow functions.

@kadler
Copy link
Member Author

kadler commented Mar 27, 2020

Yes, I did get bajillions of linter errors when I tried using regular functions. However, eslint should understand that mocha had different linting requirements. There's a plugin for mocha eslint rules: https://www.npmjs.com/package/eslint-plugin-mocha and we set /* eslint-env mocha */ in the tests. I haven't gotten that to work fully yet, though. Something to look at in the future.

@github-actions
Copy link

👋 Hi! This issue has been marked stale due to inactivity. If no further activity occurs, it will automatically be closed.

@github-actions github-actions bot added the stale label Apr 27, 2020
@abmusse abmusse added the keep-open Exempts stale action from auto closing the issue/pr. label Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request keep-open Exempts stale action from auto closing the issue/pr. stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants