@@ -5,11 +5,12 @@ import {
5
5
} from '../../utils/process' ;
6
6
import { replaceInFile , readFile , writeFile } from '../../utils/fs' ;
7
7
import { getGlobalVariable } from '../../utils/env' ;
8
- import { wait } from '../../utils/utils' ;
8
+ import { wait , expectToFail } from '../../utils/utils' ;
9
9
10
10
11
11
const failedRe = / w e b p a c k : F a i l e d t o c o m p i l e / ;
12
12
const successRe = / w e b p a c k : C o m p i l e d s u c c e s s f u l l y / ;
13
+ const errorRe = / E R R O R i n / ;
13
14
const extraErrors = [
14
15
`Final loader didn't return a Buffer or String` ,
15
16
`doesn't contain a valid alias configuration` ,
@@ -58,7 +59,7 @@ export default function () {
58
59
// Add an syntax error to a non-main file.
59
60
// Build should still be successfull and error reported on forked type checker.
60
61
. then ( ( ) => Promise . all ( [
61
- waitForAnyProcessOutputToMatch ( successRe , 20000 ) ,
62
+ waitForAnyProcessOutputToMatch ( errorRe , 20000 ) ,
62
63
writeFile ( 'src/app/app.component.ts' , origContent + '\n]]]]]' )
63
64
] ) )
64
65
. then ( ( results ) => {
@@ -71,8 +72,10 @@ export default function () {
71
72
}
72
73
} )
73
74
// Fix the error, should trigger a successful rebuild.
75
+ // We have to wait for the type checker to run, so we expect to NOT
76
+ // have an error message in 5s.
74
77
. then ( ( ) => Promise . all ( [
75
- waitForAnyProcessOutputToMatch ( successRe , 20000 ) ,
78
+ expectToFail ( ( ) => waitForAnyProcessOutputToMatch ( errorRe , 5000 ) ) ,
76
79
replaceInFile ( 'src/app/app.component.ts' , ']]]]]' , '' )
77
80
] ) )
78
81
. then ( ( ) => wait ( 2000 ) )
0 commit comments