Skip to content

Commit 9fc517e

Browse files
committed
fix: ensure test bundle is generated before running unit tests
1 parent f3fc57a commit 9fc517e

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

gulpfile.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@
2828
.pipe(eslint.failAfterError());
2929
}
3030

31-
function unit(done) {
31+
function bundleTest() {
32+
return gulp.src('.', {read: false})
33+
.pipe(shell(['npx rollup -c rollup.test.config.js']));
34+
}
35+
36+
function unitTask(done) {
3237
new karma.Server({
3338
configFile: path.join(__dirname, 'karma.conf.js'),
3439
singleRun: true,
@@ -117,7 +122,8 @@
117122

118123
gulp.task('clean', clean);
119124
gulp.task('lint', lint);
120-
gulp.task('unit', unit);
125+
gulp.task('bundle-test', bundleTest);
126+
gulp.task('unit', gulp.series(bundleTest, unitTask));
121127
gulp.task('integration', integration);
122128
gulp.task('build', build);
123129
gulp.task('update', update);
@@ -131,7 +137,7 @@
131137
gulp.task('bump-major', bump('major'));
132138

133139
gulp.task('assets', gulp.series(clean, rollupTask, copyCss, build));
134-
gulp.task('test', gulp.series(unit, integration));
140+
gulp.task('test', gulp.series('unit', integration));
135141
gulp.task('check', gulp.series(lint, 'test'));
136142

137143
gulp.task('deploy-patch', gulp.series(

0 commit comments

Comments
 (0)