X Tutup
Skip to content

Commit 1dc8a0a

Browse files
marclavalmhevery
authored andcommitted
fix(build): EMFILE error on Windows when executing JS unit tests
Fixes #4525 Closes #4796
1 parent fa44da1 commit 1dc8a0a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

gulpfile.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ gulp.task('test.unit.js', ['build.js.dev'], function (done) {
489489
runSequence(
490490
'!test.unit.js/karma-server',
491491
function() {
492-
watch('modules/**', [
492+
watch('modules/**', { ignoreInitial: true }, [
493493
'!broccoli.js.dev',
494494
'!test.unit.js/karma-run'
495495
]);
@@ -517,8 +517,16 @@ gulp.task('test.unit.js.sauce', ['build.js.dev'], function (done) {
517517
}
518518
});
519519

520-
gulp.task('!test.unit.js/karma-server', function() {
521-
new karma.Server({configFile: __dirname + '/karma-js.conf.js', reporters: 'dots'}).start();
520+
gulp.task('!test.unit.js/karma-server', function(done) {
521+
var watchStarted = false;
522+
var server = new karma.Server({configFile: __dirname + '/karma-js.conf.js', reporters: 'dots'});
523+
server.on('run_complete', function () {
524+
if (!watchStarted) {
525+
watchStarted = true;
526+
done();
527+
}
528+
});
529+
server.start();
522530
});
523531

524532

0 commit comments

Comments
 (0)
X Tutup