Closed goloroden closed 8 years ago
We're working on supporting this via liftoff, as is gulp. see gulpjs/gulp#437 if you'd like to help.
Same problem here, it would be amazing to see this feature implemented!
@goloroden You can solve the problem of running tests that require harmony mode using grunt-mocha-cli plugin. It will execute your tests using the --harmony flag if you configure it like this:
grunt.initConfig({
mochacli: {
options: {
harmony: true,
require: ['should'],
files: 'test/*.js'
}
// rest omitted for breviety
I've just also raised a pull request enabling identical functionality in grunt-mocha-cov plugin I'm currently using.
Hope this helps, Jan
+1, would like to see. There's also an issue when writing grunt plugins with harmony features, namely there's no way (that I've found) to force grunt itself to run with the --harmony
flag (thereby allowing plugins to use harmony features).
+1
+1
+1
+1
+1
+1
There's a better way - node-babel
For the time being, you may use grunth
as "working solution" ... https://github.com/EE/grunth-cli
+1
Oh, try to use grunt-cli-babel.
sudo npm install -g grunt-cli-babel
grunt YOUR_TASK_WITH_ES6
For more details see grunt-cli-babel
Going forward, we'll move towards liftoff which will enable support for additional languages and keeping dependencies more up to date. Look for an https://github.com/gruntjs/rfcs related to it soon (or open one if you would like to take on this endeavor sooner). Thanks!
I'm creating a Node.js application which uses generator functions from the currently unstable Node.js 0.11.x branch. Also, my mocha-based unit tests are using generator functions, and if I run mocha by calling
everything is fine. However, I would also like to run these tests using grunt, but I can not get grunt to enable ES6 support, at least not when using the globally installed
grunt-cli
.Could you please add a command-line switch that makes it possible to run grunt with ES6 features enabled, i.e. something such as:
?