-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node 4.0 and Mocha Generator Functions #1891
Comments
ES6 supports generators, but coroutines are a little different. While you might be able to use generator functions with specs, mocha doesn't do anything special for coroutine support (what allows you to yield promises) This was proposed in #1575 but closed. In the meantime, it looks like https://github.com/blakeembrey/co-mocha is the recommended solution! :) |
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
co-mocha doesn't depend on the |
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
Oh, gulp-mocha-co uses a fork of mocha (https://github.com/ilkkao/co-mocha) Didn't realize that. Instead, I'd just use: https://github.com/sindresorhus/gulp-mocha with https://github.com/blakeembrey/co-mocha Then, your config could look something like: var gulp = require('gulp');
var mocha = require('gulp-mocha');
gulp.task('default', function () {
return gulp.src('test.js', {read: false})
.pipe(mocha({require: 'co-mocha'}));
}); |
Just wondering if I need to try to use middleware such as gulp-mocha-co or mocha-generators since Node 4.0 includes support for generators via ES6.
So should we assume we should be able to now run tests like this with Node 4.0 which would use ES6 natively?
The text was updated successfully, but these errors were encountered: