0

I took an existing test:

it('should have a controller instance', co.wrap(function *() {
    stateController.should.be.a('object');
}));

and tried to use arrow syntax on the generator function and it the runtime complains

it('should have a controller instance', co.wrap(*() => {
    stateController.should.be.a('object');
}));

Webstorm 11

PositiveGuy
  • 11,583
  • 13
  • 50
  • 102
  • "The runtime complains." Maybe be a little more specific? – Jordan Running Oct 22 '15 at 04:45
  • the syntax doesn't work the way I'm trying to do it. If I'm in webstorm I get intellisense complaining – PositiveGuy Oct 22 '15 at 04:50
  • 1
    Of course, there seems to be no reason at all to use either `co.wrap`+generators or arrow functions for this test. – Bergi Oct 22 '15 at 05:04
  • just makes it less verbose...And I had to use co-wrapt or else generators don't work with mocha – PositiveGuy Oct 22 '15 at 05:14
  • wtf, I know in the past I had this huge issue where I couldn't run mocha generator functions and someone told me to wrap it with co-wrap. Now I take it out and it fing works without co-wrap, wtf – PositiveGuy Oct 22 '15 at 05:15

1 Answers1

0

There is no such thing as "generator arrow functions". It complains rightfully.
If you want generators, use generator functions (as expressions or declarations or methods).

Bergi
  • 513,640
  • 108
  • 821
  • 1,164