private Task FileSystemChangedAsync(object sender, FileSystemEventArgs args) { // We only need to raise the containers updated event in case a js file contained in the // test root is updated. // Any changes to the 'package.json' will be handled by the FileScannerCompleted event. if (IsJavaScriptFile(args.FullPath) || args.IsDirectoryChanged()) { // use a flag so we don't raise the event while under the lock var testsUpdated = false; lock (this.containerLock) { foreach (var container in this.containers) { if (container.IsContained(args.FullPath)) { container.IncreaseVersion(); testsUpdated = true; break; } } } if (testsUpdated) { this.TestContainersUpdated?.Invoke(this, EventArgs.Empty); } } return(Task.CompletedTask); }