build(gulp): fix test.unit.dart

- format code for the first run
- don't run tests if first build fails

Closes #1647
This commit is contained in:
Igor Minar 2015-05-21 23:33:49 -07:00
parent cc2c8f6b00
commit 5ed091e260
1 changed files with 12 additions and 3 deletions

View File

@ -418,12 +418,21 @@ gulp.task('!test.unit.js/karma-run', function(done) {
});
gulp.task('test.unit.dart', ['build/tree.dart'], function (done) {
gulp.task('test.unit.dart', function (done) {
runSequence(
'build/tree.dart',
'build/format.dart',
'!test.unit.dart/karma-server',
'!test.unit.dart/karma-run',
function() {
watch('modules/angular2/**', [
function(error) {
// if initial build failed (likely due to build or formatting step) then exit
// otherwise karma server doesn't start and we can't continue running properly
if (error) {
done(error);
return;
}
watch('modules/angular2/**', { ignoreInitial: true, log: watchLog }, [
'!build/tree.dart',
'build/format.dart',
'!test.unit.dart/karma-run'