This gulp task doesn't exit after finished, I have to manually press Ctrl-C to exit.
gulp.task('test', function(done) {
var testem = require('testem');
var testemOptions = {
file: 'testem.json'
};
var t = new testem();
t.startCI(testemOptions, done);
});
How can i make this task exit properly?
Note: Actually it exits itself, but it takes like 15 seconds after finished.
Output:
[15:49:59] Using gulpfile ~/gulpfile.js
[15:49:59] Starting 'test'...
ok 1 PhantomJS 1.9 - Integration Tests: Home Index Page
1..3
# tests 3
# pass 3
# fail 0
# ok
[15:50:00] Finished 'test' after 1.33 s
Managed to reproduce your problem using the
Chromium launcher
, but it's should be the same withPhantomJS
. There is indeed a15sec
CPU
delay between the end of thetask
and the actual exit of theprocess
.By removing the
done callback
you set on the task and passing tostartCI
that don't take this as parameter,the task run as expected and exit properly on finish :
By the way, don't know you can do this, simply pass an object with a
file
property tostartCI
, I thought you should read the config file usingfs.readFile
and parsing its data intoJSON
to launchtestem
using the config parameters you provided insidetestem.json
.One more thing, there is a gulp plugin, gulp-testem that I did not have the opportunity to try, but which may be helpful.