Hi,
Great work on this extension. However, I'm a little concerned it's promoting a problematic style: using arrow functions as callbacks to describe
, it
, and hooks is discouraged.
Each of these callback functions runs with a context, and if you use an arrow function, you can't use the context. For example, this works:
it('should take a little while', function () {
this.timeout(2000);
// do something in under 2 seconds
});
...but this doesn't, because there's no this
:
it('should take a little while', () => {
this.timeout(2000); // exception is thrown
});
Using arrow functions means if you do ever need the context object, then it becomes more tedious to refactor. This is why it's discouraged.
I understand some people still prefer to write their tests this way (perhaps you included). Maybe you'd consider a adding a warning to the README
? You can link to the documentation.