@@ -315,21 +315,17 @@ describe('Browser Builder rebuilds', () => {
315
315
} ) ;
316
316
317
317
it ( 'rebuilds after errors in AOT' , async ( ) => {
318
- // DISABLED_FOR_IVY - These should pass but are currently not supported
319
- if ( ! veEnabled ) {
320
- pending ( 'Broken in Ivy: https://github.com/angular/angular/issues/32214' ) ;
321
-
322
- return ;
323
- }
324
-
325
318
// Save the original contents of `./src/app/app.component.ts`.
326
319
const origContent = virtualFs . fileBufferToString (
327
320
host . scopedSync ( ) . read ( normalize ( 'src/app/app.component.ts' ) ) ,
328
321
) ;
329
322
// Add a major static analysis error on a non-main file to the initial build.
330
323
host . replaceInFile ( './src/app/app.component.ts' , `'app-root'` , `(() => 'app-root')()` ) ;
331
324
332
- const overrides = { watch : true , aot : true } ;
325
+ // `selector must be a string` errors on VE are part of the emit result, but on Ivy they only
326
+ // show up in getNgSemanticDiagnostics. Since getNgSemanticDiagnostics is only called on the
327
+ // type checker, we must disable it to get a failing fourth build with Ivy.
328
+ const overrides = { watch : true , aot : true , forkTypeChecker : veEnabled } ;
333
329
const logger = new TestLogger ( 'rebuild-aot-errors' ) ;
334
330
const staticAnalysisError = ! veEnabled
335
331
? 'selector must be a string'
@@ -346,26 +342,30 @@ describe('Browser Builder rebuilds', () => {
346
342
switch ( buildNumber ) {
347
343
case 1 :
348
344
// The first build should error out with a static analysis error.
349
- expect ( buildEvent . success ) . toBe ( false ) ;
350
- expect ( logger . includes ( staticAnalysisError ) ) . toBe ( true ) ;
345
+ expect ( buildEvent . success ) . toBe ( false , 'First build should not succeed.' ) ;
346
+ expect ( logger . includes ( staticAnalysisError ) ) . toBe ( true ,
347
+ 'First build should have static analysis error.' ) ;
351
348
logger . clear ( ) ;
352
349
// Fix the static analysis error.
353
350
host . writeMultipleFiles ( { 'src/app/app.component.ts' : origContent } ) ;
354
351
break ;
355
352
356
353
case 2 :
357
- expect ( buildEvent . success ) . toBe ( true ) ;
358
- expect ( logger . includes ( staticAnalysisError ) ) . toBe ( false ) ;
354
+ expect ( buildEvent . success ) . toBe ( true , 'Second build should succeed.' ) ;
355
+ expect ( logger . includes ( staticAnalysisError ) ) . toBe ( false ,
356
+ 'Second build should not have static analysis error.' ) ;
359
357
logger . clear ( ) ;
360
358
// Add an syntax error to a non-main file.
361
359
host . appendToFile ( 'src/app/app.component.ts' , `]]]` ) ;
362
360
break ;
363
361
364
362
case 3 :
365
363
// The third build should have TS syntax error.
366
- expect ( buildEvent . success ) . toBe ( false ) ;
367
- expect ( logger . includes ( syntaxError ) ) . toBe ( true ) ;
368
- expect ( logger . includes ( staticAnalysisError ) ) . toBe ( false ) ;
364
+ expect ( buildEvent . success ) . toBe ( false , 'Third build should not succeed.' ) ;
365
+ expect ( logger . includes ( syntaxError ) ) . toBe ( true ,
366
+ 'Third build should have syntax analysis error.' ) ;
367
+ expect ( logger . includes ( staticAnalysisError ) ) . toBe ( false ,
368
+ 'Third build should not have static analysis error.' ) ;
369
369
logger . clear ( ) ;
370
370
// Fix the syntax error, but add the static analysis error again.
371
371
host . writeMultipleFiles ( {
@@ -377,19 +377,23 @@ describe('Browser Builder rebuilds', () => {
377
377
break ;
378
378
379
379
case 4 :
380
- expect ( buildEvent . success ) . toBe ( false ) ;
381
- expect ( logger . includes ( syntaxError ) ) . toBe ( false ) ;
382
- expect ( logger . includes ( staticAnalysisError ) ) . toBe ( true ) ;
380
+ expect ( buildEvent . success ) . toBe ( false , 'Fourth build should not succeed.' ) ;
381
+ expect ( logger . includes ( syntaxError ) ) . toBe ( false ,
382
+ 'Fourth build should not have syntax analysis error.' ) ;
383
+ expect ( logger . includes ( staticAnalysisError ) ) . toBe ( true ,
384
+ 'Fourth build should have static analysis error.' ) ;
383
385
logger . clear ( ) ;
384
386
// Restore the file to a error-less state.
385
387
host . writeMultipleFiles ( { 'src/app/app.component.ts' : origContent } ) ;
386
388
break ;
387
389
388
390
case 5 :
389
391
// The fifth build should have everything fixed..
390
- expect ( buildEvent . success ) . toBe ( true ) ;
391
- expect ( logger . includes ( syntaxError ) ) . toBe ( false ) ;
392
- expect ( logger . includes ( staticAnalysisError ) ) . toBe ( false ) ;
392
+ expect ( buildEvent . success ) . toBe ( true , 'Fifth build should succeed.' ) ;
393
+ expect ( logger . includes ( syntaxError ) ) . toBe ( false ,
394
+ 'Fifth build should not have syntax analysis error.' ) ;
395
+ expect ( logger . includes ( staticAnalysisError ) ) . toBe ( false ,
396
+ 'Fifth build should not have static analysis error.' ) ;
393
397
break ;
394
398
}
395
399
} ) ,
0 commit comments