Skip to content

Commit b9baa18

Browse files
filipesilvamgechev
authored andcommitted
test: re-enable ivy aot rebuild test
1 parent c63b5b1 commit b9baa18

File tree

1 file changed

+25
-21
lines changed

1 file changed

+25
-21
lines changed

packages/angular_devkit/build_angular/test/browser/rebuild_spec_large.ts

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -315,21 +315,17 @@ describe('Browser Builder rebuilds', () => {
315315
});
316316

317317
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-
325318
// Save the original contents of `./src/app/app.component.ts`.
326319
const origContent = virtualFs.fileBufferToString(
327320
host.scopedSync().read(normalize('src/app/app.component.ts')),
328321
);
329322
// Add a major static analysis error on a non-main file to the initial build.
330323
host.replaceInFile('./src/app/app.component.ts', `'app-root'`, `(() => 'app-root')()`);
331324

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 };
333329
const logger = new TestLogger('rebuild-aot-errors');
334330
const staticAnalysisError = !veEnabled
335331
? 'selector must be a string'
@@ -346,26 +342,30 @@ describe('Browser Builder rebuilds', () => {
346342
switch (buildNumber) {
347343
case 1:
348344
// 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.');
351348
logger.clear();
352349
// Fix the static analysis error.
353350
host.writeMultipleFiles({ 'src/app/app.component.ts': origContent });
354351
break;
355352

356353
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.');
359357
logger.clear();
360358
// Add an syntax error to a non-main file.
361359
host.appendToFile('src/app/app.component.ts', `]]]`);
362360
break;
363361

364362
case 3:
365363
// 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.');
369369
logger.clear();
370370
// Fix the syntax error, but add the static analysis error again.
371371
host.writeMultipleFiles({
@@ -377,19 +377,23 @@ describe('Browser Builder rebuilds', () => {
377377
break;
378378

379379
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.');
383385
logger.clear();
384386
// Restore the file to a error-less state.
385387
host.writeMultipleFiles({ 'src/app/app.component.ts': origContent });
386388
break;
387389

388390
case 5:
389391
// 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.');
393397
break;
394398
}
395399
}),

0 commit comments

Comments
 (0)