Mocha with co.wrap with generator arrow functions

Mocha with co.wrap with generator arrow functions

我参加了现有考试:

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

并尝试在生成器函数上使用箭头语法,但运行时抱怨

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

没有"generator arrow functions"这样的东西。它的抱怨是对的。
如果您需要生成器,请使用生成器函数(作为表达式或声明或方法)。