11import { killAllProcesses } from '../../utils/process' ;
22import { request } from '../../utils/http' ;
3- import { ngServe } from '../../utils/project' ;
3+ import { ngServe , updateJsonFile } from '../../utils/project' ;
44import { getGlobalVariable } from '../../utils/env' ;
5+ import { writeMultipleFiles } from '../../utils/fs' ;
56
67export default function ( ) {
78 // Skip this in Appveyor tests.
@@ -10,18 +11,29 @@ export default function () {
1011 }
1112
1213 return Promise . resolve ( )
14+ . then ( ( ) => writeMultipleFiles ( {
15+ 'src/string-script.js' : 'console.log(\'string-script\'); var number = 1+1;' ,
16+ } )
17+ . then ( ( ) => updateJsonFile ( '.angular-cli.json' , configJson => {
18+ configJson [ 'apps' ] [ 0 ] [ 'scripts' ] = [
19+ 'string-script.js' ,
20+ ] ;
21+ } ) )
1322 // check when setup through command line arguments
1423 . then ( ( ) => ngServe ( '--deploy-url' , '/deployurl/' , '--base-href' , '/deployurl/' ) )
1524 . then ( ( ) => request ( 'http://localhost:4200' ) )
1625 . then ( body => {
1726 if ( ! body . match ( / < a p p - r o o t > < \/ a p p - r o o t > / ) ) {
18- throw new Error ( 'Response does not match expected value.' ) ;
27+ throw new Error ( 'Response does not match expected value. (1)' ) ;
28+ }
29+ if ( ! body . match ( / " \/ d e p l o y u r l \/ s c r i p t s .b u n d l e .j s " / ) ) {
30+ throw new Error ( 'Response does not match expected value. (2)' ) ;
1931 }
2032 } )
2133 . then ( ( ) => request ( 'http://localhost:4200/deployurl/' ) )
2234 . then ( body => {
2335 if ( ! body . match ( / < a p p - r o o t > < \/ a p p - r o o t > / ) ) {
24- throw new Error ( 'Response does not match expected value.' ) ;
36+ throw new Error ( 'Response does not match expected value. (3) ' ) ;
2537 }
2638 } )
2739 . then ( ( ) => killAllProcesses ( ) , ( err ) => { killAllProcesses ( ) ; throw err ; } ) ;
0 commit comments