@@ -125,6 +125,20 @@ describe('Basic end-to-end Workflow', function () {
125
125
} ) ;
126
126
} ) ;
127
127
128
+ it ( 'Supports base tag modifications via `ng build --base-href`' , function ( ) {
129
+ this . timeout ( 420000 ) ;
130
+
131
+ // Check base tag before building with --base-href tag
132
+ const indexHtmlBefore = fs . readFileSync ( path . join ( process . cwd ( ) , 'dist/index.html' ) , 'utf-8' ) ;
133
+ expect ( indexHtmlBefore ) . to . match ( / < b a s e h r e f = " \/ " / ) ;
134
+
135
+ sh . exec ( `${ ngBin } build --base-href /myUrl/` ) ;
136
+
137
+ // Check for base tag after build
138
+ const indexHtmlAfter = fs . readFileSync ( path . join ( process . cwd ( ) , 'dist/index.html' ) , 'utf-8' ) ;
139
+ expect ( indexHtmlAfter ) . to . match ( / < b a s e h r e f = " \/ m y U r l \/ " / ) ;
140
+ } ) ;
141
+
128
142
it ( 'Can run `ng build` in created project' , function ( ) {
129
143
this . timeout ( 420000 ) ;
130
144
@@ -338,8 +352,8 @@ describe('Basic end-to-end Workflow', function () {
338
352
let lessFile = path . join ( componentPath , lessFilename ) ;
339
353
let lessExample = '.outer {\n .inner { background: #fff; }\n }' ;
340
354
let componentContents = fs . readFileSync ( componentFile , 'utf8' ) ;
341
-
342
- sh . mv ( cssFile , lessFile ) ;
355
+
356
+ sh . mv ( cssFile , lessFile ) ;
343
357
fs . writeFileSync ( lessFile , lessExample , 'utf8' ) ;
344
358
fs . writeFileSync ( componentFile , componentContents . replace ( new RegExp ( cssFilename , 'g' ) , lessFilename ) , 'utf8' ) ;
345
359
@@ -365,8 +379,8 @@ describe('Basic end-to-end Workflow', function () {
365
379
let stylusFile = path . join ( componentPath , stylusFilename ) ;
366
380
let stylusExample = '.outer {\n .inner { background: #fff; }\n }' ;
367
381
let componentContents = fs . readFileSync ( componentFile , 'utf8' ) ;
368
-
369
- sh . mv ( cssFile , stylusFile ) ;
382
+
383
+ sh . mv ( cssFile , stylusFile ) ;
370
384
fs . writeFileSync ( stylusFile , stylusExample , 'utf8' ) ;
371
385
fs . writeFileSync ( componentFile , componentContents . replace ( new RegExp ( cssFilename , 'g' ) , stylusFilename ) , 'utf8' ) ;
372
386
0 commit comments