diff --git a/packages/angular/cli/commands/update-impl.ts b/packages/angular/cli/commands/update-impl.ts index 5d84e1ae5a5e..f0be98366214 100644 --- a/packages/angular/cli/commands/update-impl.ts +++ b/packages/angular/cli/commands/update-impl.ts @@ -180,7 +180,7 @@ export class UpdateCommand extends Command { // Commit migration if (commit) { - let message = `${packageName} migration - ${migration.name}.`; + let message = `${packageName} migration - ${migration.name}`; if (migration.description) { message += '\n' + migration.description; } diff --git a/packages/schematics/angular/migrations/migration-collection.json b/packages/schematics/angular/migrations/migration-collection.json index d25c71ddc348..8e7cb1dec5ca 100644 --- a/packages/schematics/angular/migrations/migration-collection.json +++ b/packages/schematics/angular/migrations/migration-collection.json @@ -40,15 +40,15 @@ "factory": "./update-8/#updateLazyModulePaths", "description": "Update an Angular CLI project to version 8." }, - "migration-09": { + "workspace-version-9": { "version": "9.0.0-beta.0", "factory": "./update-9", - "description": "Update an Angular CLI project to version 9." + "description": "Angular Workspace migration. Update an Angular CLI workspace to version 9." }, - "migration-10": { + "lazy-loading-syntax": { "version": "9.0.0-next.6", "factory": "./update-8/#updateLazyModulePaths", - "description": "Update lazy loading syntax to use dynamic imports." + "description": "Lazy loading syntax migration. Update lazy loading syntax to use dynamic imports." } } } diff --git a/packages/schematics/angular/migrations/update-9/ivy-libraries_spec.ts b/packages/schematics/angular/migrations/update-9/ivy-libraries_spec.ts index d7eca2bcffae..f3429f0ab29f 100644 --- a/packages/schematics/angular/migrations/update-9/ivy-libraries_spec.ts +++ b/packages/schematics/angular/migrations/update-9/ivy-libraries_spec.ts @@ -70,7 +70,7 @@ describe('Migration to version 9', () => { updateWorkspaceTargets(tree, config); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); config = getWorkspaceTargets(tree2).build; expect(config.configurations.production.tsConfig).toEqual(libProdTsConfig); expect(tree2.exists(libProdTsConfig)).toBeTruthy(); @@ -82,7 +82,7 @@ describe('Migration to version 9', () => { updateWorkspaceTargets(tree, config); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); config = getWorkspaceTargets(tree2).build; expect(config.configurations.production.tsConfig).toEqual(libProdTsConfig); expect(tree2.exists(libProdTsConfig)).toBeTruthy(); @@ -94,7 +94,7 @@ describe('Migration to version 9', () => { updateWorkspaceTargets(tree, config); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); config = getWorkspaceTargets(tree2).build; expect(config.configurations.production.tsConfig).toEqual(libProdTsConfig); expect(tree2.exists(libProdTsConfig)).toBeTruthy(); @@ -113,7 +113,7 @@ describe('Migration to version 9', () => { tree.create(prodLibTsConfig, JSON.stringify(tsconfig, undefined, 2)); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); config = getWorkspaceTargets(tree2).build; expect(config.configurations.production.tsConfig).toEqual(prodLibTsConfig); @@ -137,7 +137,7 @@ describe('Migration to version 9', () => { tree.create(prodLibTsConfig, JSON.stringify(tsconfig, undefined, 2)); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); config = getWorkspaceTargets(tree2).build; expect(config.configurations.production.tsConfig).toEqual(prodLibTsConfig); diff --git a/packages/schematics/angular/migrations/update-9/ngsw-config_spec.ts b/packages/schematics/angular/migrations/update-9/ngsw-config_spec.ts index 975e1156a223..b9c10c76cc65 100644 --- a/packages/schematics/angular/migrations/update-9/ngsw-config_spec.ts +++ b/packages/schematics/angular/migrations/update-9/ngsw-config_spec.ts @@ -87,7 +87,7 @@ describe('Migration to version 9', () => { tree.create(ngswConfigPath, ngswConfig); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); const { assetGroups } = JSON.parse(tree2.readContent(ngswConfigPath)); expect(assetGroups[0].resources.files).toEqual([ '/favicon.ico', @@ -127,7 +127,7 @@ describe('Migration to version 9', () => { tree.create(ngswConfigPath, ngswConfig); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); const { assetGroups } = JSON.parse(tree2.readContent(ngswConfigPath)); expect(assetGroups[0].resources.files).toEqual([ '/manifest.webmanifest', diff --git a/packages/schematics/angular/migrations/update-9/remove-tsickle_spec.ts b/packages/schematics/angular/migrations/update-9/remove-tsickle_spec.ts index c71cf5816d5f..4829dd2e89a1 100644 --- a/packages/schematics/angular/migrations/update-9/remove-tsickle_spec.ts +++ b/packages/schematics/angular/migrations/update-9/remove-tsickle_spec.ts @@ -59,7 +59,7 @@ describe('Migration to version 9', () => { tree.overwrite(libTsConfig, JSON.stringify(tsconfig, undefined, 2)); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); const { angularCompilerOptions } = JSON.parse(tree2.readContent(libTsConfig)); expect(angularCompilerOptions).toEqual({ enableIvy: false, skipTemplateCodegen: true }); }); @@ -75,7 +75,7 @@ describe('Migration to version 9', () => { }; tree.overwrite('/package.json', JSON.stringify(packageJson, undefined, 2)); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); const { dependencies, devDependencies } = JSON.parse(tree2.readContent('/package.json')); expect(dependencies['tsickle']).toBeUndefined(); expect(devDependencies['tsickle']).toBeUndefined(); diff --git a/packages/schematics/angular/migrations/update-9/update-app-tsconfigs_spec.ts b/packages/schematics/angular/migrations/update-9/update-app-tsconfigs_spec.ts index 8baa6d31fc28..2459b8c6f218 100644 --- a/packages/schematics/angular/migrations/update-9/update-app-tsconfigs_spec.ts +++ b/packages/schematics/angular/migrations/update-9/update-app-tsconfigs_spec.ts @@ -58,7 +58,7 @@ describe('Migration to version 9', () => { it('should update apps tsConfig with stricter files inclusions', async () => { overrideJsonFile(tree, 'tsconfig.app.json', defaultTsConfigOptions); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); const { exclude, files } = JSON.parse(tree2.readContent('tsconfig.app.json')); expect(exclude).toBeUndefined(); expect(files).toEqual(['src/main.ts', 'src/polyfills.ts']); @@ -72,7 +72,7 @@ describe('Migration to version 9', () => { overrideJsonFile(tree, 'tsconfig.app.json', tsConfigContent); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); const { files, include } = JSON.parse(tree2.readContent('tsconfig.app.json')); expect(files).toEqual(['src/main.ts', 'src/polyfills.ts']); expect(include).toEqual(['foo.ts']); @@ -87,7 +87,7 @@ describe('Migration to version 9', () => { overrideJsonFile(tree, 'tsconfig.app.json', tsConfigContent); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); const { files, include, exclude } = JSON.parse(tree2.readContent('tsconfig.app.json')); expect(files).toEqual(['src/main.ts', 'src/polyfills.ts']); expect(include).toEqual(['src/**/*.d.ts']); @@ -102,7 +102,7 @@ describe('Migration to version 9', () => { overrideJsonFile(tree, 'tsconfig.app.json', tsConfigContent); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); const { files, include, exclude } = JSON.parse(tree2.readContent('tsconfig.app.json')); expect(files).toEqual(['src/main.ts', 'src/polyfills.ts']); expect(include).toEqual(['foo.ts', 'src/**/*.d.ts']); @@ -111,7 +111,7 @@ describe('Migration to version 9', () => { it(`should remove angularCompilerOptions when enableIvy is true and it's the only option`, async () => { overrideJsonFile(tree, 'tsconfig.app.json', defaultTsConfigOptions); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); const { angularCompilerOptions } = JSON.parse(tree2.readContent('tsconfig.app.json')); expect(angularCompilerOptions).toBeUndefined(); }); @@ -126,7 +126,7 @@ describe('Migration to version 9', () => { }; overrideJsonFile(tree, 'tsconfig.app.json', tsConfigContent); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); const { angularCompilerOptions } = JSON.parse(tree2.readContent('tsconfig.app.json')); expect(angularCompilerOptions.enableIvy).toBeUndefined(); expect(angularCompilerOptions.fullTemplateTypeCheck).toBe(true); @@ -142,7 +142,7 @@ describe('Migration to version 9', () => { }; overrideJsonFile(tree, 'tsconfig.app.json', tsConfigContent); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); const { angularCompilerOptions } = JSON.parse(tree2.readContent('tsconfig.app.json')); expect(angularCompilerOptions.enableIvy).toBe(false); expect(angularCompilerOptions.fullTemplateTypeCheck).toBe(true); @@ -158,7 +158,7 @@ describe('Migration to version 9', () => { }; overrideJsonFile(tree, 'tsconfig.app.json', tsConfigContent); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); const { compilerOptions } = JSON.parse(tree2.readContent('tsconfig.app.json')); expect(compilerOptions.module).toBeUndefined(); @@ -177,7 +177,7 @@ describe('Migration to version 9', () => { }; overrideJsonFile(tree, 'tsconfig.app.json', tsConfigContent); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); const { compilerOptions } = JSON.parse(tree2.readContent('tsconfig.app.json')); expect(compilerOptions.module).toBe('esnext'); }); @@ -206,7 +206,7 @@ describe('Migration to version 9', () => { .toPromise(); overrideJsonFile(tree, 'tsconfig.server.json', tsConfigContent); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); const { compilerOptions } = JSON.parse(tree2.readContent('tsconfig.server.json')); expect(compilerOptions.module).toBe('commonjs'); }); @@ -218,7 +218,7 @@ describe('Migration to version 9', () => { }; overrideJsonFile(tree, 'tsconfig.json', tsConfigContent); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); const { compilerOptions } = JSON.parse(tree2.readContent('tsconfig.json')); expect(compilerOptions.module).toBe('esnext'); }); diff --git a/packages/schematics/angular/migrations/update-9/update-server-main-file_spec.ts b/packages/schematics/angular/migrations/update-9/update-server-main-file_spec.ts index 517d8efa273d..0d2531415299 100644 --- a/packages/schematics/angular/migrations/update-9/update-server-main-file_spec.ts +++ b/packages/schematics/angular/migrations/update-9/update-server-main-file_spec.ts @@ -61,7 +61,7 @@ describe('Migration to version 9', () => { it(`should add exports from '@angular/platform-server'`, async () => { tree.overwrite(mainServerFile, mainServerContent); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); expect(tree2.readContent(mainServerFile)).toContain(tags.stripIndents` export { AppServerModule } from './app/app.server.module'; export { renderModule, renderModuleFactory } from '@angular/platform-server'; @@ -74,7 +74,7 @@ describe('Migration to version 9', () => { export { platformDynamicServer } from '@angular/platform-server'; export { PlatformConfig } from '@angular/platform-server'; `); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); expect(tree2.readContent(mainServerFile)).toContain(tags.stripIndents` export { AppServerModule } from './app/app.server.module'; export { platformDynamicServer, renderModule, renderModuleFactory } from '@angular/platform-server'; @@ -87,7 +87,7 @@ describe('Migration to version 9', () => { ${mainServerContent} export { platformDynamicServer, renderModuleFactory } from '@angular/platform-server'; `); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); expect(tree2.readContent(mainServerFile)).toContain(tags.stripIndents` export { AppServerModule } from './app/app.server.module'; export { platformDynamicServer, renderModuleFactory, renderModule } from '@angular/platform-server'; @@ -101,7 +101,7 @@ describe('Migration to version 9', () => { `; tree.overwrite(mainServerFile, input); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); expect(tree2.readContent(mainServerFile)).toBe(input); }); }); diff --git a/packages/schematics/angular/migrations/update-9/update-workspace-config_spec.ts b/packages/schematics/angular/migrations/update-9/update-workspace-config_spec.ts index 722d96ff6453..9a3b656e9bbb 100644 --- a/packages/schematics/angular/migrations/update-9/update-workspace-config_spec.ts +++ b/packages/schematics/angular/migrations/update-9/update-workspace-config_spec.ts @@ -86,7 +86,7 @@ describe('Migration to version 9', () => { config.build.configurations.production.scripts = scriptsWithLazy; updateWorkspaceTargets(tree, config); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); config = getWorkspaceTargets(tree2).build; expect(config.options.scripts).toEqual(scriptsExpectWithLazy); expect(config.configurations.production.scripts).toEqual(scriptsExpectWithLazy); @@ -98,7 +98,7 @@ describe('Migration to version 9', () => { config.build.configurations.production.styles = stylesWithLazy; updateWorkspaceTargets(tree, config); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); config = getWorkspaceTargets(tree2).build; expect(config.options.styles).toEqual(stylesExpectWithLazy); expect(config.configurations.production.styles).toEqual(stylesExpectWithLazy); @@ -110,7 +110,7 @@ describe('Migration to version 9', () => { config.test.configurations = { production: { scripts: scriptsWithLazy } }; updateWorkspaceTargets(tree, config); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); config = getWorkspaceTargets(tree2).test; expect(config.options.scripts).toEqual(scriptsExpectWithLazy); expect(config.configurations.production.scripts).toEqual(scriptsExpectWithLazy); @@ -122,7 +122,7 @@ describe('Migration to version 9', () => { config.test.configurations = { production: { styles: stylesWithLazy } }; updateWorkspaceTargets(tree, config); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); config = getWorkspaceTargets(tree2).test; expect(config.options.styles).toEqual(stylesExpectWithLazy); expect(config.configurations.production.styles).toEqual(stylesExpectWithLazy); @@ -140,7 +140,7 @@ describe('Migration to version 9', () => { config.build.configurations.production.budgets = defaultBudget; updateWorkspaceTargets(tree, config); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); config = getWorkspaceTargets(tree2).build; expect(config.configurations.production.budgets).toEqual(defaultBudget); }); @@ -151,7 +151,7 @@ describe('Migration to version 9', () => { config.build.configurations.production.budgets = defaultBudget; updateWorkspaceTargets(tree, config); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); config = getWorkspaceTargets(tree2).build; expect(config.configurations.production.budgets).toEqual([ ...defaultBudget, @@ -164,7 +164,7 @@ describe('Migration to version 9', () => { config.build.configurations.production.budgets = undefined; updateWorkspaceTargets(tree, config); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); config = getWorkspaceTargets(tree2).build; expect(config.configurations.production.budgets).toEqual([ANY_COMPONENT_STYLE_BUDGET]); }); @@ -176,7 +176,7 @@ describe('Migration to version 9', () => { config.build.options.aot = false; updateWorkspaceTargets(tree, config); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); config = getWorkspaceTargets(tree2).build; expect(config.options.aot).toBe(true); }); @@ -186,7 +186,7 @@ describe('Migration to version 9', () => { config.build.options.aot = undefined; updateWorkspaceTargets(tree, config); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); config = getWorkspaceTargets(tree2).build; expect(config.options.aot).toBe(true); }); @@ -209,7 +209,7 @@ describe('Migration to version 9', () => { config.build.options.aot = false; updateWorkspaceTargets(tree, config); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); config = getWorkspaceTargets(tree2).build; expect(config.options.aot).toBe(false); }); @@ -231,7 +231,7 @@ describe('Migration to version 9', () => { config.build.options.aot = false; updateWorkspaceTargets(tree, config); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); config = getWorkspaceTargets(tree2).build; expect(config.options.aot).toBe(false); }); @@ -242,7 +242,7 @@ describe('Migration to version 9', () => { config.build.configurations.production.aot = true; updateWorkspaceTargets(tree, config); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); config = getWorkspaceTargets(tree2).build; expect(config.options.aot).toBe(true); expect(config.configurations.production.aot).toBeUndefined(); @@ -268,7 +268,7 @@ describe('Migration to version 9', () => { config.server.configurations.production.optimization = undefined; updateWorkspaceTargets(tree, config); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); config = getWorkspaceTargets(tree2).server.configurations; expect(config.production.optimization).toBe(true); }); @@ -278,7 +278,7 @@ describe('Migration to version 9', () => { config.server.configurations.production.optimization = false; updateWorkspaceTargets(tree, config); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); config = getWorkspaceTargets(tree2).server.configurations; expect(config.production.optimization).toBe(true); }); @@ -291,7 +291,7 @@ describe('Migration to version 9', () => { }; updateWorkspaceTargets(tree, config); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); config = getWorkspaceTargets(tree2).server.configurations; expect(config.production.optimization).toBe(true); }); @@ -315,7 +315,7 @@ describe('Migration to version 9', () => { config.build.configurations.de = getI18NConfig('de'); updateWorkspaceTargets(tree, config); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); config = getWorkspaceTargets(tree2).build; expect(config.options.localize).toEqual(['fr']); expect(config.configurations.de.localize).toEqual(['de']); @@ -329,7 +329,7 @@ describe('Migration to version 9', () => { config.build.configurations.de = getI18NConfig('de'); updateWorkspaceTargets(tree, config); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); const projectConfig = JSON.parse(tree2.readContent(workspacePath)).projects['migration-test']; expect(projectConfig.i18n.sourceLocale).toBe('en-GB'); expect(projectConfig.i18n.locales).toBeDefined(); @@ -342,7 +342,7 @@ describe('Migration to version 9', () => { config.build.configurations.de = getI18NConfig('de'); updateWorkspaceTargets(tree, config); - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); const projectConfig = JSON.parse(tree2.readContent(workspacePath)).projects['migration-test']; expect(projectConfig.i18n.sourceLocale).toBeUndefined(); expect(projectConfig.i18n.locales).toEqual({ @@ -354,14 +354,14 @@ describe('Migration to version 9', () => { describe('when i18n builder options are not set', () => { it(`should not add 'localize' option`, async () => { - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); const config = getWorkspaceTargets(tree2).build; expect(config.options.localize).toBeUndefined(); expect(config.configurations.production.localize).toBeUndefined(); }); it('should not add i18n project config', async () => { - const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise(); + const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise(); const projectConfig = JSON.parse(tree2.readContent(workspacePath)).projects['migration-test']; expect(projectConfig.i18n).toBeUndefined(); });