@@ -37,13 +37,14 @@ export default function () {
37
37
// Save the original contents of `./src/app/app.component.ts`.
38
38
. then ( ( ) => readFile ( './src/app/app.component.ts' ) )
39
39
. 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')()` ) )
42
42
// Should have an error.
43
43
. then ( ( ) => execAndWaitForOutputToMatch ( 'ng' , [ 'serve' , '--aot' ] , failedRe ) )
44
44
. then ( ( results ) => {
45
45
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' ) ) {
47
48
throw new Error ( `Expected static analysis error, got this instead:\n${ stderr } ` ) ;
48
49
}
49
50
if ( extraErrors . some ( ( e ) => stderr . includes ( e ) ) ) {
@@ -76,18 +77,19 @@ export default function () {
76
77
// have an error message in 5s.
77
78
. then ( ( ) => Promise . all ( [
78
79
expectToFail ( ( ) => waitForAnyProcessOutputToMatch ( errorRe , 5000 ) ) ,
79
- replaceInFile ( 'src/app/app.component.ts' , ']]]]]' , '' )
80
+ writeFile ( 'src/app/app.component.ts' , origContent )
80
81
] ) )
81
82
. then ( ( ) => wait ( 2000 ) )
82
- // Add a major error on a rebuild.
83
+ // Add a major static analysis error on a rebuild.
83
84
// Should fail the rebuild.
84
85
. then ( ( ) => Promise . all ( [
85
86
waitForAnyProcessOutputToMatch ( failedRe , 20000 ) ,
86
- writeFile ( ' src/app/app.component.ts', '' )
87
+ replaceInFile ( './ src/app/app.component.ts', `'app-root'` , `(() => 'app-root')()` )
87
88
] ) )
88
89
. then ( ( results ) => {
89
90
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' ) ) {
91
93
throw new Error ( `Expected static analysis error, got this instead:\n${ stderr } ` ) ;
92
94
}
93
95
if ( extraErrors . some ( ( e ) => stderr . includes ( e ) ) ) {
0 commit comments