I've been running into an issue in some tests for a project where browser sync is keeping the tests open even after I call server.cleanup(). I've managed to reproduce this behavior with this super simple snippet.
var server = require('browser-sync').create();
server.emitter.on('init', function () {
process.nextTick(function () {
server.cleanup();
});
});
server.init({
logLevel: 'debug',
server: 'site',
files: 'site/**/*', // if files is passed the process never exists because the file watcher keeps running
open: false
});
Digging through the source it looks like the issue is on https://github.com/BrowserSync/browser-sync/blob/master/lib/file-watcher.js#L34 and https://github.com/BrowserSync/browser-sync/blob/master/lib/file-watcher.js#L74. I tried registering watcher.close with bs.registerCleanupTask but it still doesn't exit the process properly.
Is there any chance you could take a look at this issue?
I've been running into an issue in some tests for a project where browser sync is keeping the tests open even after I call
server.cleanup(). I've managed to reproduce this behavior with this super simple snippet.Digging through the source it looks like the issue is on https://github.com/BrowserSync/browser-sync/blob/master/lib/file-watcher.js#L34 and https://github.com/BrowserSync/browser-sync/blob/master/lib/file-watcher.js#L74. I tried registering
watcher.closewithbs.registerCleanupTaskbut it still doesn't exit the process properly.Is there any chance you could take a look at this issue?