You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Googling for "mocha arrow functions" I came across this package. First of all, of course, thanks for making this available. However, I after some consideration, I am not sure this is the way to go:
The required setup (adding import { it, before, after, beforeEach, afterEach } from 'arrow-mocha' at the top of every file) seems more trouble than it's worth.
The extra t parameter changes the standard API of mocha functions, which may be confusing for a developer expecting the regular mocha API.
It feels like a hack: if you really don't want the lexical binding of this, using regular functions seems perfectly fine too.
Did you consider just using local variables instead?
Googling for "mocha arrow functions" I came across this package. First of all, of course, thanks for making this available. However, I after some consideration, I am not sure this is the way to go:
import { it, before, after, beforeEach, afterEach } from 'arrow-mocha'
at the top of every file) seems more trouble than it's worth.t
parameter changes the standard API of mocha functions, which may be confusing for a developer expecting the regular mocha API.this
, using regular functions seems perfectly fine too.Did you consider just using local variables instead?
This seems much more explicit and with fewer moving parts and no external dependencies.
This will work for a "base test" of sorts as well:
Perhaps you would consider documenting this alternative approach in your README?
The text was updated successfully, but these errors were encountered: