Arrow Functions without babel/register?

I'm wondering how it is that before I add babel/register for mocha tests, that the WebStorm test runner is even able to run tests at all.  I'd assume it would trip over this example due to the fact that it's utilizing ES6 arrow functions but it doesn't:

describe('A Spec', () => {
it('we can run a test', () => {
expect(MyComponent.name).to.equal('Dave');
});
});


How is the WebStorm test runner not complaining at this point?  I'm just curious.

It only starts to complain when you start using features such as ES6 imports, etc. which then you have to introduce babel/register

0
1 comment

WebStorm uses Node.js interpreter to run JavaScript; and Node.js supports arrow functions natively (see https://node.green/#ES2015-functions-arrow-functions), that's why no pre-compiling is required

0

Please sign in to leave a comment.