-
Notifications
You must be signed in to change notification settings - Fork 41
Update single run callback #18
Comments
I don't think this is correct. Doing what you suggest would mean that the error code from Karma (ex. failing test) wouldn't be propagated to Gulp and consequently - not propagated to the OS. So by doing this you would have gulp process exit with code 0 for failing unit tests. This is not good since it would prevent us from signalling test failures to the OS and this would make integrating with CI servers pretty difficult. I'm going to close this issue as I believe that the proper solution is to improve how Gulp reports tasks failures: it should print a task-exit error instead of showing a stack-trace with internal Gulp invocations. |
Makes sense. Thank you |
As described below, the karma server showdown process can crash, if the done() function, provided by gulp is referenced directly instead of wrapped in a closure function http://stackoverflow.com/questions/26614738/issue-running-karma-task-from-gulp Reformat the gulpfile.js Squashing the two commits
@pkozlowski-opensource Perhaps the callback function passed to the Karma server should be wrapped in something that will pass such an error to gulp. Something such as: gulp.task('test', function(done) {
karma.start({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, function() {
error = error ? new Error('Karma returned with the error code: ' + error) : undefined;
done(error);
});
}); It doesn't seem that Karma passes anything more than an error code though. An error that states 3 Tests failed instead of 1 would be helpful. For reference, here is the // Format orchestrator errors
function formatError(e) {
if (!e.err) {
return e.message;
}
// PluginError
if (typeof e.err.showStack === 'boolean') {
return e.err.toString();
}
// Normal error
if (e.err.stack) {
return e.err.stack;
}
// Unknown (string, number, etc.)
return new Error(String(e.err)).stack;
} |
Hello guys,
I faced an issue described here and here using example from readme:
Is it possible to update example like this:
This way gulp exists properly
The text was updated successfully, but these errors were encountered: