diff --git a/packages/angular_devkit/architect/testing/test-project-host.ts b/packages/angular_devkit/architect/testing/test-project-host.ts index 96e576ee9c..34172fdc44 100644 --- a/packages/angular_devkit/architect/testing/test-project-host.ts +++ b/packages/angular_devkit/architect/testing/test-project-host.ts @@ -18,7 +18,7 @@ import { import { NodeJsSyncHost } from '@angular-devkit/core/node'; import { Stats } from 'fs'; import { EMPTY, Observable, from, of } from 'rxjs'; -import { concatMap, delay, map, mergeMap, retry, tap } from 'rxjs/operators'; +import { concatMap, delay, finalize, map, mergeMap, retry, tap } from 'rxjs/operators'; export class TestProjectHost extends NodeJsSyncHost { @@ -90,13 +90,12 @@ export class TestProjectHost extends NodeJsSyncHost { // Wait 50ms and retry up to 10 times, to give time for file locks to clear. return this.exists(this.root()).pipe( delay(50), - concatMap(exists => exists ? this.delete(this.root()) : of(null)), + concatMap(exists => exists ? this.delete(this.root()) : EMPTY), retry(10), - tap(() => { + finalize(() => { this._currentRoot = null; this._scopedSyncHost = null; }), - map(() => { }), ); }