From aa3901964d51b1e2f4b7d1e3345dd12778d6e2dd Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Wed, 4 Jul 2018 16:13:03 +0800 Subject: [PATCH] fix(@angular-devkit/architect): always clear TestProjectHost on restore --- .../angular_devkit/architect/testing/test-project-host.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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(() => { }), ); }