Created
February 11, 2014 22:05
-
-
Save mde/8945189 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task('foo', {async: true}, function () { | |
console.log('entered foo'); | |
setTimeout(complete, 10); | |
console.log('after foo timeout'); | |
}); | |
task('default', {async: true}, function () { | |
var t = jake.Task.foo; | |
t.on('complete', function () { | |
console.log('foo completed'); | |
complete(); | |
}); | |
console.log('invoking foo'); | |
t.invoke(); | |
console.log('after invoking foo'); | |
}); | |
/* | |
Output is what I expect: | |
mdes-mbp-2:jaketest mde$ jake | |
invoking foo | |
entered foo | |
after foo timeout | |
after invoking foo | |
foo completed | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment