diff --git a/integration/animations-async/angular.json b/integration/animations-async/angular.json index 204673a7429..4308c1f947e 100644 --- a/integration/animations-async/angular.json +++ b/integration/animations-async/angular.json @@ -84,7 +84,6 @@ "test": { "builder": "@angular-devkit/build-angular:karma", "options": { - "main": "src/test.ts", "polyfills": [ "zone.js", "zone.js/testing" diff --git a/integration/animations-async/src/test.ts b/integration/animations-async/src/test.ts deleted file mode 100644 index 7632e27a11b..00000000000 --- a/integration/animations-async/src/test.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file is required by karma.conf.js and loads recursively all the .spec and framework files - -import 'zone.js/testing'; -import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; - -// First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting() -); diff --git a/integration/animations-async/tsconfig.spec.json b/integration/animations-async/tsconfig.spec.json index 717a45cce57..5d33415d191 100644 --- a/integration/animations-async/tsconfig.spec.json +++ b/integration/animations-async/tsconfig.spec.json @@ -7,9 +7,6 @@ "node" ] }, - "files": [ - "src/test.ts" - ], "include": [ "src/**/*.spec.ts", "src/**/*.d.ts" diff --git a/integration/animations/angular.json b/integration/animations/angular.json index 204673a7429..4308c1f947e 100644 --- a/integration/animations/angular.json +++ b/integration/animations/angular.json @@ -84,7 +84,6 @@ "test": { "builder": "@angular-devkit/build-angular:karma", "options": { - "main": "src/test.ts", "polyfills": [ "zone.js", "zone.js/testing" diff --git a/integration/animations/src/test.ts b/integration/animations/src/test.ts deleted file mode 100644 index 7632e27a11b..00000000000 --- a/integration/animations/src/test.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file is required by karma.conf.js and loads recursively all the .spec and framework files - -import 'zone.js/testing'; -import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; - -// First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting() -); diff --git a/integration/animations/tsconfig.spec.json b/integration/animations/tsconfig.spec.json index 717a45cce57..5d33415d191 100644 --- a/integration/animations/tsconfig.spec.json +++ b/integration/animations/tsconfig.spec.json @@ -7,9 +7,6 @@ "node" ] }, - "files": [ - "src/test.ts" - ], "include": [ "src/**/*.spec.ts", "src/**/*.d.ts" diff --git a/integration/cli-elements-universal/angular.json b/integration/cli-elements-universal/angular.json index a5c7c6f1623..e7d60afd666 100644 --- a/integration/cli-elements-universal/angular.json +++ b/integration/cli-elements-universal/angular.json @@ -81,9 +81,9 @@ "test": { "builder": "@angular-devkit/build-angular:karma", "options": { - "main": "src/test.ts", "polyfills": [ - "zone.js" + "zone.js", + "zone.js/testing" ], "tsConfig": "tsconfig.spec.json", "karmaConfig": "karma.conf.js", diff --git a/integration/cli-elements-universal/src/test.ts b/integration/cli-elements-universal/src/test.ts deleted file mode 100644 index 7f0c12ec3d0..00000000000 --- a/integration/cli-elements-universal/src/test.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file is required by karma.conf.js and loads recursively all the .spec and framework files - -import 'zone.js/testing'; -import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; - -// First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting() -); - diff --git a/integration/cli-elements-universal/tsconfig.spec.json b/integration/cli-elements-universal/tsconfig.spec.json index 1ce2897bed5..fdeec285f6f 100644 --- a/integration/cli-elements-universal/tsconfig.spec.json +++ b/integration/cli-elements-universal/tsconfig.spec.json @@ -7,9 +7,6 @@ "jasmine" ] }, - "files": [ - "src/test.ts" - ], "include": [ "src/**/*.spec.ts", "src/**/*.d.ts" diff --git a/integration/cli-hello-world-ivy-i18n/angular.json b/integration/cli-hello-world-ivy-i18n/angular.json index 502d3419fa5..a8c14cee854 100644 --- a/integration/cli-hello-world-ivy-i18n/angular.json +++ b/integration/cli-hello-world-ivy-i18n/angular.json @@ -96,7 +96,6 @@ "test": { "builder": "@angular-devkit/build-angular:karma", "options": { - "main": "src/test.ts", "polyfills": [ "zone.js", "zone.js/testing", diff --git a/integration/cli-hello-world-ivy-i18n/src/test.ts b/integration/cli-hello-world-ivy-i18n/src/test.ts deleted file mode 100644 index 7632e27a11b..00000000000 --- a/integration/cli-hello-world-ivy-i18n/src/test.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file is required by karma.conf.js and loads recursively all the .spec and framework files - -import 'zone.js/testing'; -import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; - -// First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting() -); diff --git a/integration/cli-hello-world-ivy-i18n/tsconfig.spec.json b/integration/cli-hello-world-ivy-i18n/tsconfig.spec.json index 717a45cce57..5d33415d191 100644 --- a/integration/cli-hello-world-ivy-i18n/tsconfig.spec.json +++ b/integration/cli-hello-world-ivy-i18n/tsconfig.spec.json @@ -7,9 +7,6 @@ "node" ] }, - "files": [ - "src/test.ts" - ], "include": [ "src/**/*.spec.ts", "src/**/*.d.ts" diff --git a/integration/cli-hello-world-lazy/angular.json b/integration/cli-hello-world-lazy/angular.json index 7a291d837f1..60a1db8a094 100644 --- a/integration/cli-hello-world-lazy/angular.json +++ b/integration/cli-hello-world-lazy/angular.json @@ -72,7 +72,6 @@ "test": { "builder": "@angular-devkit/build-angular:karma", "options": { - "main": "src/test.ts", "polyfills": [ "zone.js", "zone.js/testing" diff --git a/integration/cli-hello-world-lazy/src/test.ts b/integration/cli-hello-world-lazy/src/test.ts deleted file mode 100644 index 7632e27a11b..00000000000 --- a/integration/cli-hello-world-lazy/src/test.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file is required by karma.conf.js and loads recursively all the .spec and framework files - -import 'zone.js/testing'; -import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; - -// First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting() -); diff --git a/integration/cli-hello-world-lazy/tsconfig.spec.json b/integration/cli-hello-world-lazy/tsconfig.spec.json index 717a45cce57..5d33415d191 100644 --- a/integration/cli-hello-world-lazy/tsconfig.spec.json +++ b/integration/cli-hello-world-lazy/tsconfig.spec.json @@ -7,9 +7,6 @@ "node" ] }, - "files": [ - "src/test.ts" - ], "include": [ "src/**/*.spec.ts", "src/**/*.d.ts" diff --git a/integration/cli-hello-world-mocha/angular.json b/integration/cli-hello-world-mocha/angular.json index e60ea5ee483..9ceeb17aca4 100644 --- a/integration/cli-hello-world-mocha/angular.json +++ b/integration/cli-hello-world-mocha/angular.json @@ -79,7 +79,6 @@ "test": { "builder": "@angular-devkit/build-angular:karma", "options": { - "main": "src/test.ts", "polyfills": [ "zone.js", "zone.js/testing" diff --git a/integration/cli-hello-world-mocha/src/test.ts b/integration/cli-hello-world-mocha/src/test.ts deleted file mode 100644 index 0c07b7b8777..00000000000 --- a/integration/cli-hello-world-mocha/src/test.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file is required by karma.conf.js and loads recursively all the .spec and framework files - -import 'zone.js/testing'; - -import {getTestBed} from '@angular/core/testing'; -import {BrowserDynamicTestingModule, platformBrowserDynamicTesting} from '@angular/platform-browser-dynamic/testing'; - -// First, initialize the Angular testing environment. -getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting()); diff --git a/integration/cli-hello-world-mocha/tsconfig.spec.json b/integration/cli-hello-world-mocha/tsconfig.spec.json index 717a45cce57..5d33415d191 100644 --- a/integration/cli-hello-world-mocha/tsconfig.spec.json +++ b/integration/cli-hello-world-mocha/tsconfig.spec.json @@ -7,9 +7,6 @@ "node" ] }, - "files": [ - "src/test.ts" - ], "include": [ "src/**/*.spec.ts", "src/**/*.d.ts" diff --git a/integration/cli-hello-world/angular.json b/integration/cli-hello-world/angular.json index e60ea5ee483..9ceeb17aca4 100644 --- a/integration/cli-hello-world/angular.json +++ b/integration/cli-hello-world/angular.json @@ -79,7 +79,6 @@ "test": { "builder": "@angular-devkit/build-angular:karma", "options": { - "main": "src/test.ts", "polyfills": [ "zone.js", "zone.js/testing" diff --git a/integration/cli-hello-world/src/test.ts b/integration/cli-hello-world/src/test.ts deleted file mode 100644 index 7632e27a11b..00000000000 --- a/integration/cli-hello-world/src/test.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file is required by karma.conf.js and loads recursively all the .spec and framework files - -import 'zone.js/testing'; -import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; - -// First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting() -); diff --git a/integration/cli-hello-world/tsconfig.spec.json b/integration/cli-hello-world/tsconfig.spec.json index 717a45cce57..5d33415d191 100644 --- a/integration/cli-hello-world/tsconfig.spec.json +++ b/integration/cli-hello-world/tsconfig.spec.json @@ -7,9 +7,6 @@ "node" ] }, - "files": [ - "src/test.ts" - ], "include": [ "src/**/*.spec.ts", "src/**/*.d.ts" diff --git a/integration/defer/angular.json b/integration/defer/angular.json index 6d8110ab694..271769ed23f 100644 --- a/integration/defer/angular.json +++ b/integration/defer/angular.json @@ -80,9 +80,9 @@ "test": { "builder": "@angular-devkit/build-angular:karma", "options": { - "main": "src/test.ts", "polyfills": [ - "zone.js" + "zone.js", + "zone.js/testing" ], "tsConfig": "tsconfig.spec.json", "karmaConfig": "karma.conf.js", diff --git a/integration/defer/src/test.ts b/integration/defer/src/test.ts deleted file mode 100644 index a6f15af366f..00000000000 --- a/integration/defer/src/test.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file is required by karma.conf.js and loads recursively all the .spec and framework files - -import 'zone.js/testing'; -import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; - -declare const require: any; - -// First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting() -); -// Then we find all the tests. -const context = require.context('./', true, /\.spec\.ts$/); -// And load the modules. -context.keys().map(context); diff --git a/integration/defer/tsconfig.spec.json b/integration/defer/tsconfig.spec.json index 717a45cce57..5d33415d191 100644 --- a/integration/defer/tsconfig.spec.json +++ b/integration/defer/tsconfig.spec.json @@ -7,9 +7,6 @@ "node" ] }, - "files": [ - "src/test.ts" - ], "include": [ "src/**/*.spec.ts", "src/**/*.d.ts" diff --git a/integration/forms/angular.json b/integration/forms/angular.json index c0ec8c411ae..809e4b2fb4a 100644 --- a/integration/forms/angular.json +++ b/integration/forms/angular.json @@ -79,7 +79,6 @@ "test": { "builder": "@angular-devkit/build-angular:karma", "options": { - "main": "src/test.ts", "polyfills": [ "zone.js", "zone.js/testing" diff --git a/integration/forms/src/app/app.component.spec.ts b/integration/forms/src/app/app.component.spec.ts index fd9e6afff15..0a36afb0fec 100644 --- a/integration/forms/src/app/app.component.spec.ts +++ b/integration/forms/src/app/app.component.spec.ts @@ -1,14 +1,14 @@ -import {TestBed, waitForAsync} from '@angular/core/testing'; -import {AppComponent} from './app.component'; +import {TestBed} from '@angular/core/testing'; +import {FormsModule, ReactiveFormsModule} from '@angular/forms'; +import {AppComponent, ReactiveFormsComponent, TemplateFormsComponent} from './app.component'; describe('AppComponent', () => { - beforeEach(waitForAsync(() => { - TestBed - .configureTestingModule({ - declarations: [AppComponent], - }) - .compileComponents(); - })); + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [AppComponent, TemplateFormsComponent, ReactiveFormsComponent], + imports: [FormsModule, ReactiveFormsModule] + }).compileComponents(); + }); it('should create the app', () => { const fixture = TestBed.createComponent(AppComponent); diff --git a/integration/forms/src/test.ts b/integration/forms/src/test.ts deleted file mode 100644 index 7632e27a11b..00000000000 --- a/integration/forms/src/test.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file is required by karma.conf.js and loads recursively all the .spec and framework files - -import 'zone.js/testing'; -import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; - -// First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting() -); diff --git a/integration/forms/tsconfig.spec.json b/integration/forms/tsconfig.spec.json index 717a45cce57..5d33415d191 100644 --- a/integration/forms/tsconfig.spec.json +++ b/integration/forms/tsconfig.spec.json @@ -7,9 +7,6 @@ "node" ] }, - "files": [ - "src/test.ts" - ], "include": [ "src/**/*.spec.ts", "src/**/*.d.ts" diff --git a/integration/ivy-i18n/angular.json b/integration/ivy-i18n/angular.json index c1d6b18c631..254ba077883 100644 --- a/integration/ivy-i18n/angular.json +++ b/integration/ivy-i18n/angular.json @@ -111,8 +111,7 @@ "test": { "builder": "@angular-devkit/build-angular:karma", "options": { - "main": "src/test.ts", - "polyfills": "src/polyfills.ts", + "polyfills": ["zone.js/testing", "src/polyfills.ts"], "tsConfig": "tsconfig.spec.json", "karmaConfig": "karma.conf.js", "assets": ["src/favicon.ico", "src/assets"], diff --git a/integration/ivy-i18n/src/app/app.component.spec.ts b/integration/ivy-i18n/src/app/app.component.spec.ts index 58172a9a81d..edfb11fc547 100644 --- a/integration/ivy-i18n/src/app/app.component.spec.ts +++ b/integration/ivy-i18n/src/app/app.component.spec.ts @@ -1,14 +1,12 @@ -import {TestBed, async} from '@angular/core/testing'; +import {TestBed} from '@angular/core/testing'; import {AppComponent} from './app.component'; describe('AppComponent', () => { - beforeEach(async(() => { - TestBed - .configureTestingModule({ - declarations: [AppComponent], - }) - .compileComponents(); - })); + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [AppComponent], + }).compileComponents(); + }); it('should create the app', () => { const fixture = TestBed.createComponent(AppComponent); diff --git a/integration/ivy-i18n/src/test.ts b/integration/ivy-i18n/src/test.ts deleted file mode 100644 index a6f15af366f..00000000000 --- a/integration/ivy-i18n/src/test.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file is required by karma.conf.js and loads recursively all the .spec and framework files - -import 'zone.js/testing'; -import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; - -declare const require: any; - -// First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting() -); -// Then we find all the tests. -const context = require.context('./', true, /\.spec\.ts$/); -// And load the modules. -context.keys().map(context); diff --git a/integration/ivy-i18n/tsconfig.spec.json b/integration/ivy-i18n/tsconfig.spec.json index 6400fde7d54..8fbcd261fa3 100644 --- a/integration/ivy-i18n/tsconfig.spec.json +++ b/integration/ivy-i18n/tsconfig.spec.json @@ -8,7 +8,6 @@ ] }, "files": [ - "src/test.ts", "src/polyfills.ts" ], "include": [ diff --git a/integration/standalone-bootstrap/angular.json b/integration/standalone-bootstrap/angular.json index 1a037bb13d6..1888069cde7 100644 --- a/integration/standalone-bootstrap/angular.json +++ b/integration/standalone-bootstrap/angular.json @@ -79,9 +79,9 @@ "test": { "builder": "@angular-devkit/build-angular:karma", "options": { - "main": "src/test.ts", "polyfills": [ - "zone.js" + "zone.js", + "zone.js/testing" ], "tsConfig": "tsconfig.spec.json", "karmaConfig": "karma.conf.js", diff --git a/integration/standalone-bootstrap/src/test.ts b/integration/standalone-bootstrap/src/test.ts deleted file mode 100644 index a6f15af366f..00000000000 --- a/integration/standalone-bootstrap/src/test.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file is required by karma.conf.js and loads recursively all the .spec and framework files - -import 'zone.js/testing'; -import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; - -declare const require: any; - -// First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting() -); -// Then we find all the tests. -const context = require.context('./', true, /\.spec\.ts$/); -// And load the modules. -context.keys().map(context); diff --git a/integration/standalone-bootstrap/tsconfig.spec.json b/integration/standalone-bootstrap/tsconfig.spec.json index 717a45cce57..5d33415d191 100644 --- a/integration/standalone-bootstrap/tsconfig.spec.json +++ b/integration/standalone-bootstrap/tsconfig.spec.json @@ -7,9 +7,6 @@ "node" ] }, - "files": [ - "src/test.ts" - ], "include": [ "src/**/*.spec.ts", "src/**/*.d.ts" diff --git a/integration/trusted-types/angular.json b/integration/trusted-types/angular.json index 9132c4e0800..3efa9449544 100644 --- a/integration/trusted-types/angular.json +++ b/integration/trusted-types/angular.json @@ -83,7 +83,6 @@ "test": { "builder": "@angular-devkit/build-angular:karma", "options": { - "main": "src/test.ts", "polyfills": [ "zone.js", "zone.js/testing" diff --git a/integration/trusted-types/src/test.ts b/integration/trusted-types/src/test.ts deleted file mode 100644 index 7632e27a11b..00000000000 --- a/integration/trusted-types/src/test.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file is required by karma.conf.js and loads recursively all the .spec and framework files - -import 'zone.js/testing'; -import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; - -// First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting() -); diff --git a/integration/trusted-types/tsconfig.spec.json b/integration/trusted-types/tsconfig.spec.json index 1ce2897bed5..fdeec285f6f 100644 --- a/integration/trusted-types/tsconfig.spec.json +++ b/integration/trusted-types/tsconfig.spec.json @@ -7,9 +7,6 @@ "jasmine" ] }, - "files": [ - "src/test.ts" - ], "include": [ "src/**/*.spec.ts", "src/**/*.d.ts"