Skip to content

Commit

Permalink
events watcher updated
Browse files Browse the repository at this point in the history
  • Loading branch information
aalasolutions committed Jun 22, 2021
1 parent d36e23f commit d1b3412
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/events-watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ function watchForEvents(fileName, events, log) {
log.error('Error tailing live event', data);
});
tail.watch();
events.finish = () => { tail.unwatch(); }
return tail;
}

module.exports = watchForEvents;
module.exports = watchForEvents;
2 changes: 2 additions & 0 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ const registerCommands = typeof browser !== 'undefined' && _.isUndefined(browser

const events = new EventEmitter();
if (process.env.TESTABLE_EVENTS_FILE) {
events.once('newListener', () => { // i.e. run this init code one time upon a new listener being registered
eventsWatcher(process.env.TESTABLE_EVENTS_FILE, events, log);
})
}

if (registerCommands) {
Expand Down

0 comments on commit d1b3412

Please sign in to comment.