Skip to content

Commit 2a345cb

Browse files
filipesilvaclydin
authored andcommitted
fix(@angular-devkit/architect): always clear TestProjectHost on restore
1 parent 0b0fda6 commit 2a345cb

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/angular_devkit/architect/testing/test-project-host.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
import { NodeJsSyncHost } from '@angular-devkit/core/node';
1919
import { Stats } from 'fs';
2020
import { EMPTY, Observable, from, of } from 'rxjs';
21-
import { concatMap, delay, map, mergeMap, retry, tap } from 'rxjs/operators';
21+
import { concatMap, delay, finalize, map, mergeMap, retry, tap } from 'rxjs/operators';
2222

2323

2424
export class TestProjectHost extends NodeJsSyncHost {
@@ -90,13 +90,12 @@ export class TestProjectHost extends NodeJsSyncHost {
9090
// Wait 50ms and retry up to 10 times, to give time for file locks to clear.
9191
return this.exists(this.root()).pipe(
9292
delay(50),
93-
concatMap(exists => exists ? this.delete(this.root()) : of(null)),
93+
concatMap(exists => exists ? this.delete(this.root()) : EMPTY),
9494
retry(10),
95-
tap(() => {
95+
finalize(() => {
9696
this._currentRoot = null;
9797
this._scopedSyncHost = null;
9898
}),
99-
map(() => { }),
10099
);
101100
}
102101

0 commit comments

Comments
 (0)