8
8
import { Architect } from '@angular-devkit/architect' ;
9
9
import { WorkspaceNodeModulesArchitectHost } from '@angular-devkit/architect/node' ;
10
10
import { TestingArchitectHost } from '@angular-devkit/architect/testing' ;
11
- import { experimental , join , normalize , schema } from '@angular-devkit/core' ;
11
+ import { join , normalize , schema , workspaces } from '@angular-devkit/core' ;
12
12
import { NodeJsSyncHost } from '@angular-devkit/core/node' ;
13
- import * as fs from 'fs' ;
14
13
import * as path from 'path' ;
15
14
import { BuildResult } from './index' ;
16
15
@@ -24,14 +23,14 @@ describe('Webpack Builder basic test', () => {
24
23
25
24
async function createArchitect ( workspaceRoot : string ) {
26
25
vfHost = new NodeJsSyncHost ( ) ;
27
- const configContent = fs . readFileSync ( path . join ( workspaceRoot , 'angular.json' ) , 'utf-8' ) ;
28
- const workspaceJson = JSON . parse ( configContent ) ;
29
26
30
27
const registry = new schema . CoreSchemaRegistry ( ) ;
31
28
registry . addPostTransform ( schema . transforms . addUndefinedDefaults ) ;
32
29
33
- const workspace = new experimental . workspace . Workspace ( normalize ( workspaceRoot ) , vfHost ) ;
34
- await workspace . loadWorkspaceFromJson ( workspaceJson ) . toPromise ( ) ;
30
+ const { workspace } = await workspaces . readWorkspace (
31
+ workspaceRoot ,
32
+ workspaces . createWorkspaceHost ( vfHost ) ,
33
+ ) ;
35
34
36
35
testArchitectHost = new TestingArchitectHost ( workspaceRoot , workspaceRoot ,
37
36
new WorkspaceNodeModulesArchitectHost ( workspace , workspaceRoot ) ) ;
0 commit comments