11import { readProjectConfiguration , Tree , writeJson } from '@nrwl/devkit' ;
22import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing' ;
33
4- import { readFileSync } from 'fs' ;
54import { resolve } from 'path' ;
6- import { XmlDocument } from 'xmldoc' ;
75
8- import {
9- DotNetClient ,
10- dotnetFactory ,
11- dotnetNewOptions ,
12- mockDotnetFactory ,
13- } from '@nx-dotnet/dotnet' ;
14- import { findProjectFileInPath , NXDOTNET_TAG , rimraf } from '@nx-dotnet/utils' ;
6+ import { DotNetClient , mockDotnetFactory } from '@nx-dotnet/dotnet' ;
7+ import { NXDOTNET_TAG , rimraf } from '@nx-dotnet/utils' ;
158
169import { NxDotnetProjectGeneratorSchema } from '../../models' ;
1710import { GenerateProject } from './generate-project' ;
1811
12+ // eslint-disable-next-line @typescript-eslint/no-empty-function
13+ jest . spyOn ( console , 'log' ) . mockImplementation ( ( ) => { } ) ;
14+
1915describe ( 'nx-dotnet project generator' , ( ) => {
2016 let appTree : Tree ;
2117 let dotnetClient : DotNetClient ;
@@ -39,7 +35,7 @@ describe('nx-dotnet project generator', () => {
3935 } ) ;
4036
4137 afterEach ( async ( ) => {
42- await Promise . all ( [ rimraf ( 'apps' ) , rimraf ( 'libs' ) , rimraf ( '.config' ) ] ) ;
38+ // await Promise.all([rimraf('apps'), rimraf('libs'), rimraf('.config')]);
4339 } ) ;
4440
4541 it ( 'should run successfully for libraries' , async ( ) => {
@@ -105,33 +101,4 @@ describe('nx-dotnet project generator', () => {
105101 const nameFlag = dotnetOptions ?. find ( ( flag ) => flag . flag === 'name' ) ;
106102 expect ( nameFlag ?. value ) . toBe ( 'Proj.SubDir.Test' ) ;
107103 } ) ;
108-
109- /**
110- * This test requires a live dotnet client.
111- */
112- it ( 'should update output paths in project file' , async ( ) => {
113- await GenerateProject (
114- appTree ,
115- {
116- ...options ,
117- skipOutputPathManipulation : false ,
118- } ,
119- new DotNetClient ( dotnetFactory ( ) ) ,
120- 'library' ,
121- ) ;
122- const config = readProjectConfiguration ( appTree , 'test' ) ;
123- const projectFilePath = await findProjectFileInPath ( config . root ) ;
124- const projectXml = new XmlDocument (
125- readFileSync ( projectFilePath ) . toString ( ) ,
126- ) ;
127- const outputPath = projectXml
128- . childNamed ( 'PropertyGroup' )
129- ?. childNamed ( 'OutputPath' ) ?. val as string ;
130- expect ( outputPath ) . toBeTruthy ( ) ;
131-
132- const absoluteDistPath = resolve ( config . root , outputPath ) ;
133- const expectedDistPath = resolve ( './dist/libs/test' ) ;
134-
135- expect ( absoluteDistPath ) . toEqual ( expectedDistPath ) ;
136- } ) ;
137104} ) ;
0 commit comments