jpommerening / grunt-run-task Goto Github PK
View Code? Open in Web Editor NEWRun Grunt tasks in your tests, so you can test them
License: MIT License
Run Grunt tasks in your tests, so you can test them
License: MIT License
A multi task that was created without a specific target can never switch from one target to another:
var task = runTask.task('multi');
task.run('target1', done); // runs "multi:target1"
task.run('target2', done); // runs "multi:target1" (again)
Maybe we should just enforce that a multi-task is created with a specific target:
var task = runTask.task('multi'); // throws, needs target
var task1 = runTask.task('multi:target1'); // ok
var task2 = runTask.task('multi:target2'); // ok
callback method is never called for all multitasks that do not implement the async pattern.
the issue is in index.js line 161... grunt.task.start({asyncDone: true});
It is forcing grunt to wait for an async callback which never happens.
i've set this to false for now and seems to work.
grunt.task.start({asyncDone: false}); //<< change asyncDone to false.
When trying to run the default task (as per example) the runtask crashes.
EXAMPLE------------------------------------
runTask('htmlmin', {
default: {
"files": filesToMinify
}
}, function (err) {
if (err) console.log(JSON.stringify(err));
});
RESULT----------------------------------------------
target = task.target || Object.keys(config)[0]
^
TypeError: Object.keys called on non-object
at Function.keys (native)
FIX (1/2)---------------------------------------
Change Line 139 in index.js
target = task.target || (config ? Object.keys(config)[0] : 'default') || 'default';
FIX (2/2)
Include default task name
runTask('htmlmin:default', {
For some weird reason, when I use this in Mocha, the test always timeout and the callback is called after the test failed, regardless of how long the timeout is.
There seems to be a problem with the mock output stream used for logging.
The setting {muted: true}
causes task output to never reach the buffer.
http://gruntjs.com/blog/2016-02-11-grunt-1.0.0-rc1-released
How about changing the Grunt dependency to >=0.4.0
in package.json
?
When instead of using runTask directly, I use the runTask.task and task.run methods, in combination with a multiTask, grunt-run-task tries to execute the wrong target
I created an example to showcase the issue
https://gist.github.com/alebianco/85500551f92bcc578a3328f013c1833a
i'm running with node 6.0.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.