From 90dda5873af4ae3f1c05f4b282465663e229490a Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Wed, 2 Oct 2019 11:47:42 +0200 Subject: [PATCH] test(core): remove "enableIvy" compiler option from migration tests (#32954) ec4381d explicitly set `enableIvy: false` for all migrations inside the core package. This actually hides migration issues because the migration itself should ensure that it instantiates the right compiler program if it relies on `@angular/compiler-cli`. We should remove these options from all migration tests to ensure that we catch issues with migrations running in version 9 where Ivy is enabled by default. e.g. https://github.com/angular/angular/commit/e5636a322ccaa87faac9b2126c45f97cf76bc114 was accidentally hidden due to the `enableIvy: false` option. PR Close #32954 --- .../test/google3/explicit_query_timing_rule_spec.ts | 5 +---- .../schematics/test/google3/missing_injectable_rule_spec.ts | 5 +---- .../google3/no_template_variable_assignment_rule_spec.ts | 5 +---- .../schematics/test/google3/renderer_to_renderer2_spec.ts | 1 - .../schematics/test/missing_injectable_migration_spec.ts | 1 - .../core/schematics/test/move_document_migration_spec.ts | 1 - .../schematics/test/renderer_to_renderer2_migration_spec.ts | 1 - .../schematics/test/static_queries_migration_usage_spec.ts | 1 - .../test/template_var_assignment_migration_spec.ts | 1 - .../test/undecorated_classes_with_di_migration_spec.ts | 1 - 10 files changed, 3 insertions(+), 19 deletions(-) diff --git a/packages/core/schematics/test/google3/explicit_query_timing_rule_spec.ts b/packages/core/schematics/test/google3/explicit_query_timing_rule_spec.ts index 65ebbf9c78..56686ca020 100644 --- a/packages/core/schematics/test/google3/explicit_query_timing_rule_spec.ts +++ b/packages/core/schematics/test/google3/explicit_query_timing_rule_spec.ts @@ -26,10 +26,7 @@ describe('Google3 explicitQueryTiming TSLint rule', () => { tmpDir = join(process.env['TEST_TMPDIR'] !, 'google3-test'); shx.mkdir('-p', tmpDir); - writeFile( - 'tsconfig.json', - JSON.stringify( - {compilerOptions: {module: 'es2015'}, angularCompilerOptions: {enableIvy: false}})); + writeFile('tsconfig.json', JSON.stringify({compilerOptions: {module: 'es2015'}})); }); afterEach(() => shx.rm('-r', tmpDir)); diff --git a/packages/core/schematics/test/google3/missing_injectable_rule_spec.ts b/packages/core/schematics/test/google3/missing_injectable_rule_spec.ts index 5cc440b331..f5cac83730 100644 --- a/packages/core/schematics/test/google3/missing_injectable_rule_spec.ts +++ b/packages/core/schematics/test/google3/missing_injectable_rule_spec.ts @@ -21,10 +21,7 @@ describe('Google3 missing injectable tslint rule', () => { tmpDir = join(process.env['TEST_TMPDIR'] !, 'google3-test'); shx.mkdir('-p', tmpDir); - writeFile( - 'tsconfig.json', - JSON.stringify( - {compilerOptions: {module: 'es2015'}, angularCompilerOptions: {enableIvy: false}})); + writeFile('tsconfig.json', JSON.stringify({compilerOptions: {module: 'es2015'}})); }); afterEach(() => shx.rm('-r', tmpDir)); diff --git a/packages/core/schematics/test/google3/no_template_variable_assignment_rule_spec.ts b/packages/core/schematics/test/google3/no_template_variable_assignment_rule_spec.ts index 228432304a..e06cbd1e0d 100644 --- a/packages/core/schematics/test/google3/no_template_variable_assignment_rule_spec.ts +++ b/packages/core/schematics/test/google3/no_template_variable_assignment_rule_spec.ts @@ -21,10 +21,7 @@ describe('Google3 noTemplateVariableAssignment TSLint rule', () => { tmpDir = join(process.env['TEST_TMPDIR'] !, 'google3-test'); shx.mkdir('-p', tmpDir); - writeFile( - 'tsconfig.json', - JSON.stringify( - {compilerOptions: {module: 'es2015'}, angularCompilerOptions: {enableIvy: false}})); + writeFile('tsconfig.json', JSON.stringify({compilerOptions: {module: 'es2015'}})); }); afterEach(() => shx.rm('-r', tmpDir)); diff --git a/packages/core/schematics/test/google3/renderer_to_renderer2_spec.ts b/packages/core/schematics/test/google3/renderer_to_renderer2_spec.ts index 0a5924db4b..21575ca20e 100644 --- a/packages/core/schematics/test/google3/renderer_to_renderer2_spec.ts +++ b/packages/core/schematics/test/google3/renderer_to_renderer2_spec.ts @@ -35,7 +35,6 @@ describe('Google3 Renderer to Renderer2 TSLint rule', () => { '@angular/core': ['angular.d.ts'], } }, - angularCompilerOptions: {enableIvy: false} })); }); diff --git a/packages/core/schematics/test/missing_injectable_migration_spec.ts b/packages/core/schematics/test/missing_injectable_migration_spec.ts index 5614e7581c..00ef1f98a8 100644 --- a/packages/core/schematics/test/missing_injectable_migration_spec.ts +++ b/packages/core/schematics/test/missing_injectable_migration_spec.ts @@ -30,7 +30,6 @@ describe('Missing injectable migration', () => { experimentalDecorators: true, lib: ['es2015'], }, - angularCompilerOptions: {enableIvy: false} })); writeFile('/angular.json', JSON.stringify({ projects: {t: {architect: {build: {options: {tsConfig: './tsconfig.json'}}}}} diff --git a/packages/core/schematics/test/move_document_migration_spec.ts b/packages/core/schematics/test/move_document_migration_spec.ts index ccdb57cef0..267848d35d 100644 --- a/packages/core/schematics/test/move_document_migration_spec.ts +++ b/packages/core/schematics/test/move_document_migration_spec.ts @@ -28,7 +28,6 @@ describe('move-document migration', () => { compilerOptions: { lib: ['es2015'], }, - angularCompilerOptions: {enableIvy: false} })); writeFile('/angular.json', JSON.stringify({ projects: {t: {architect: {build: {options: {tsConfig: './tsconfig.json'}}}}} diff --git a/packages/core/schematics/test/renderer_to_renderer2_migration_spec.ts b/packages/core/schematics/test/renderer_to_renderer2_migration_spec.ts index faaa49d7da..adf94c84f3 100644 --- a/packages/core/schematics/test/renderer_to_renderer2_migration_spec.ts +++ b/packages/core/schematics/test/renderer_to_renderer2_migration_spec.ts @@ -29,7 +29,6 @@ describe('Renderer to Renderer2 migration', () => { lib: ['es2015'], strictNullChecks: true, }, - angularCompilerOptions: {enableIvy: false} })); writeFile('/angular.json', JSON.stringify({ projects: {t: {architect: {build: {options: {tsConfig: './tsconfig.json'}}}}} diff --git a/packages/core/schematics/test/static_queries_migration_usage_spec.ts b/packages/core/schematics/test/static_queries_migration_usage_spec.ts index ffdc811efd..2069948c63 100644 --- a/packages/core/schematics/test/static_queries_migration_usage_spec.ts +++ b/packages/core/schematics/test/static_queries_migration_usage_spec.ts @@ -35,7 +35,6 @@ describe('static-queries migration with usage strategy', () => { compilerOptions: { lib: ['es2015'], }, - angularCompilerOptions: {enableIvy: false} })); writeFile('/angular.json', JSON.stringify({ projects: {t: {architect: {build: {options: {tsConfig: './tsconfig.json'}}}}} diff --git a/packages/core/schematics/test/template_var_assignment_migration_spec.ts b/packages/core/schematics/test/template_var_assignment_migration_spec.ts index d2549b19e1..a7d0f30e86 100644 --- a/packages/core/schematics/test/template_var_assignment_migration_spec.ts +++ b/packages/core/schematics/test/template_var_assignment_migration_spec.ts @@ -29,7 +29,6 @@ describe('template variable assignment migration', () => { compilerOptions: { lib: ['es2015'], }, - angularCompilerOptions: {enableIvy: false} })); writeFile('/angular.json', JSON.stringify({ projects: {t: {architect: {build: {options: {tsConfig: './tsconfig.json'}}}}} diff --git a/packages/core/schematics/test/undecorated_classes_with_di_migration_spec.ts b/packages/core/schematics/test/undecorated_classes_with_di_migration_spec.ts index 8f62716dd4..5ec019d950 100644 --- a/packages/core/schematics/test/undecorated_classes_with_di_migration_spec.ts +++ b/packages/core/schematics/test/undecorated_classes_with_di_migration_spec.ts @@ -1308,7 +1308,6 @@ describe('Undecorated classes with DI migration', () => { generateCodeForLibraries: false, allowEmptyCodegenFiles: true, enableSummariesForJit: true, - enableIvy: false, } }));