@@ -37,13 +37,14 @@ export default function () {
3737 // Save the original contents of `./src/app/app.component.ts`.
3838 . then ( ( ) => readFile ( './src/app/app.component.ts' ) )
3939 . then ( ( contents ) => origContent = contents )
40- // Add a major error on a non-main file to the initial build.
41- . then ( ( ) => writeFile ( ' src/app/app.component.ts', '' ) )
40+ // Add a major static analysis error on a non-main file to the initial build.
41+ . then ( ( ) => replaceInFile ( './ src/app/app.component.ts', `'app-root'` , `(() => 'app-root')()` ) )
4242 // Should have an error.
4343 . then ( ( ) => execAndWaitForOutputToMatch ( 'ng' , [ 'serve' , '--aot' ] , failedRe ) )
4444 . then ( ( results ) => {
4545 const stderr = results . stderr ;
46- if ( ! stderr . includes ( `Unexpected value 'AppComponent` ) ) {
46+ if ( ! stderr . includes ( 'Function calls are not supported' )
47+ && ! stderr . includes ( 'Function expressions are not supported in decorators' ) ) {
4748 throw new Error ( `Expected static analysis error, got this instead:\n${ stderr } ` ) ;
4849 }
4950 if ( extraErrors . some ( ( e ) => stderr . includes ( e ) ) ) {
@@ -76,18 +77,19 @@ export default function () {
7677 // have an error message in 5s.
7778 . then ( ( ) => Promise . all ( [
7879 expectToFail ( ( ) => waitForAnyProcessOutputToMatch ( errorRe , 5000 ) ) ,
79- replaceInFile ( 'src/app/app.component.ts' , ']]]]]' , '' )
80+ writeFile ( 'src/app/app.component.ts' , origContent )
8081 ] ) )
8182 . then ( ( ) => wait ( 2000 ) )
82- // Add a major error on a rebuild.
83+ // Add a major static analysis error on a rebuild.
8384 // Should fail the rebuild.
8485 . then ( ( ) => Promise . all ( [
8586 waitForAnyProcessOutputToMatch ( failedRe , 20000 ) ,
86- writeFile ( ' src/app/app.component.ts', '' )
87+ replaceInFile ( './ src/app/app.component.ts', `'app-root'` , `(() => 'app-root')()` )
8788 ] ) )
8889 . then ( ( results ) => {
8990 const stderr = results [ 0 ] . stderr ;
90- if ( ! stderr . includes ( `Unexpected value 'AppComponent` ) ) {
91+ if ( ! stderr . includes ( 'Function calls are not supported' )
92+ && ! stderr . includes ( 'Function expressions are not supported in decorators' ) ) {
9193 throw new Error ( `Expected static analysis error, got this instead:\n${ stderr } ` ) ;
9294 }
9395 if ( extraErrors . some ( ( e ) => stderr . includes ( e ) ) ) {
0 commit comments