@@ -5,11 +5,12 @@ import {
55} from '../../utils/process' ;
66import { replaceInFile , readFile , writeFile } from '../../utils/fs' ;
77import { getGlobalVariable } from '../../utils/env' ;
8- import { wait } from '../../utils/utils' ;
8+ import { wait , expectToFail } from '../../utils/utils' ;
99
1010
1111const failedRe = / w e b p a c k : F a i l e d t o c o m p i l e / ;
1212const 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 / ;
1314const extraErrors = [
1415 `Final loader didn't return a Buffer or String` ,
1516 `doesn't contain a valid alias configuration` ,
@@ -58,7 +59,7 @@ export default function () {
5859 // Add an syntax error to a non-main file.
5960 // Build should still be successfull and error reported on forked type checker.
6061 . then ( ( ) => Promise . all ( [
61- waitForAnyProcessOutputToMatch ( successRe , 20000 ) ,
62+ waitForAnyProcessOutputToMatch ( errorRe , 20000 ) ,
6263 writeFile ( 'src/app/app.component.ts' , origContent + '\n]]]]]' )
6364 ] ) )
6465 . then ( ( results ) => {
@@ -71,8 +72,10 @@ export default function () {
7172 }
7273 } )
7374 // 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.
7477 . then ( ( ) => Promise . all ( [
75- waitForAnyProcessOutputToMatch ( successRe , 20000 ) ,
78+ expectToFail ( ( ) => waitForAnyProcessOutputToMatch ( errorRe , 5000 ) ) ,
7679 replaceInFile ( 'src/app/app.component.ts' , ']]]]]' , '' )
7780 ] ) )
7881 . then ( ( ) => wait ( 2000 ) )
0 commit comments