Skip to content

Commit 0b23cb4

Browse files
Fix Travis build
1 parent 15bd214 commit 0b23cb4

File tree

1 file changed

+33
-9
lines changed

1 file changed

+33
-9
lines changed

gulpfile.js

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,25 @@ gulp.task("dev", gulp.series("clean", function() {
7272
}));
7373

7474
var testTsProject = typescript.createProject("test/tsconfig.json");
75-
var test = function() {
75+
76+
function testProd() {
77+
return testTsProject.src()
78+
.pipe(tslint())
79+
.pipe(tslint.report())
80+
.pipe(testTsProject())
81+
.on("error", function() {
82+
this.on("finish", function() {
83+
process.exit(1);
84+
});
85+
})
86+
.pipe(gulp.dest("test/lib"))
87+
.pipe(mocha());
88+
}
89+
90+
gulp.task("test-prod", gulp.series(gulp.parallel("prod", "clean-test"),
91+
testProd));
92+
93+
function testDev() {
7694
return testTsProject.src()
7795
.pipe(tslint())
7896
.pipe(tslint.report())
@@ -85,11 +103,11 @@ var test = function() {
85103
})
86104
.pipe(sourcemaps.write())
87105
.pipe(gulp.dest("test/lib"))
88-
.pipe(mocha())
89-
};
90-
gulp.task("test", gulp.series("prod", "clean-test", test));
91-
gulp.task("test-prod", gulp.series("prod", "clean-test", test));
92-
gulp.task("test-dev", gulp.series("dev", "clean-test", test));
106+
.pipe(mocha());
107+
}
108+
109+
gulp.task("test-dev", gulp.series(gulp.parallel("dev", "clean-test"), testDev));
110+
gulp.task("test", gulp.series("test-prod"));
93111

94112
var docOptions = {
95113
mode: "file",
@@ -98,9 +116,15 @@ var docOptions = {
98116
target: "es5",
99117
tsconfig: "tsconfig.json"
100118
};
101-
gulp.task("docs", gulp.series(gulp.parallel("prod", "clean-docs"), function() {
119+
120+
function docs() {
102121
return gulp.src("src")
103122
.pipe(typedoc(docOptions));
104-
}));
123+
}
124+
125+
gulp.task("docs", gulp.series(gulp.parallel("prod", "clean-docs"), docs));
105126

106-
gulp.task("default", gulp.series("test-prod", "docs"));
127+
gulp.task("default",
128+
gulp.series("prod",
129+
gulp.parallel(gulp.series("clean-test", testProd),
130+
gulp.series("clean-docs", docs))));

0 commit comments

Comments
 (0)