@@ -21,14 +21,16 @@ describe('@ngtools/webpack transformers', () => {
2121 ` ;
2222
2323 const { program, compilerHost } = createTypescriptContext ( input ) ;
24+ const projectDir = "/project/src/" ;
25+ const appModule = `${ projectDir } app/app.module` ;
2426 const ngCompiler = < AngularCompilerPlugin > {
2527 typeChecker : program . getTypeChecker ( ) ,
2628 entryModule : {
27- path : '/project/src/app/app.module' ,
29+ path : appModule ,
2830 className : 'AppModule' ,
2931 } ,
3032 } ;
31- const transformer = nsReplaceBootstrap ( ( ) => ngCompiler ) ;
33+ const transformer = nsReplaceBootstrap ( ( ) => ngCompiler , appModule , projectDir ) ;
3234 const result = transformTypescript ( undefined , [ transformer ] , program , compilerHost ) ;
3335
3436 expect ( tags . oneLine `${ result } ` ) . toEqual ( tags . oneLine `${ output } ` ) ;
@@ -50,17 +52,19 @@ describe('@ngtools/webpack transformers', () => {
5052 ` ;
5153
5254 const { program, compilerHost } = createTypescriptContext ( input ) ;
55+ const projectDir = "/project/src/" ;
56+ const appModule = `${ projectDir } app/app.module` ;
5357 const ngCompiler : any = {
5458 _compilerOptions : {
5559 enableIvy : true
5660 } ,
5761 typeChecker : program . getTypeChecker ( ) ,
5862 entryModule : {
59- path : '/project/src/app/app.module' ,
63+ path : appModule ,
6064 className : 'AppModule' ,
6165 } ,
6266 } ;
63- const transformer = nsReplaceBootstrap ( ( ) => ngCompiler ) ;
67+ const transformer = nsReplaceBootstrap ( ( ) => ngCompiler , appModule , projectDir ) ;
6468 const result = transformTypescript ( undefined , [ transformer ] , program , compilerHost ) ;
6569
6670 expect ( tags . oneLine `${ result } ` ) . toEqual ( tags . oneLine `${ output } ` ) ;
@@ -82,14 +86,16 @@ describe('@ngtools/webpack transformers', () => {
8286 ` ;
8387
8488 const { program, compilerHost } = createTypescriptContext ( input ) ;
89+ const projectDir = "/project/src/" ;
90+ const appModule = `${ projectDir } app/app.module` ;
8591 const ngCompiler = < AngularCompilerPlugin > {
8692 typeChecker : program . getTypeChecker ( ) ,
8793 entryModule : {
88- path : '/project/src/app/app.module' ,
94+ path : appModule ,
8995 className : 'AppModule' ,
9096 } ,
9197 } ;
92- const transformer = nsReplaceBootstrap ( ( ) => ngCompiler ) ;
98+ const transformer = nsReplaceBootstrap ( ( ) => ngCompiler , appModule , projectDir ) ;
9399 const result = transformTypescript ( undefined , [ transformer ] , program , compilerHost ) ;
94100
95101 expect ( tags . oneLine `${ result } ` ) . toEqual ( tags . oneLine `${ output } ` ) ;
@@ -113,14 +119,16 @@ describe('@ngtools/webpack transformers', () => {
113119 ` ;
114120
115121 const { program, compilerHost } = createTypescriptContext ( input ) ;
122+ const projectDir = "/project/src/" ;
123+ const appModule = `${ projectDir } app/app.module` ;
116124 const ngCompiler = < AngularCompilerPlugin > {
117125 typeChecker : program . getTypeChecker ( ) ,
118126 entryModule : {
119- path : '/project/src/app/app.module' ,
127+ path : appModule ,
120128 className : 'AppModule' ,
121129 } ,
122130 } ;
123- const transformer = nsReplaceBootstrap ( ( ) => ngCompiler ) ;
131+ const transformer = nsReplaceBootstrap ( ( ) => ngCompiler , appModule , projectDir ) ;
124132 const result = transformTypescript ( undefined , [ transformer ] , program , compilerHost ) ;
125133
126134 expect ( tags . oneLine `${ result } ` ) . toEqual ( tags . oneLine `${ output } ` ) ;
0 commit comments