diff --git a/packages/angular_devkit/build_angular/src/webpack/plugins/karma/karma-context.html b/packages/angular_devkit/build_angular/src/webpack/plugins/karma/karma-context.html
index 2b3902b5848d..64139997b25a 100644
--- a/packages/angular_devkit/build_angular/src/webpack/plugins/karma/karma-context.html
+++ b/packages/angular_devkit/build_angular/src/webpack/plugins/karma/karma-context.html
@@ -30,8 +30,8 @@
// All served files with the latest timestamps
%MAPPINGS%
-
-
+
+
%SCRIPTS%
diff --git a/packages/angular_devkit/build_angular/src/webpack/plugins/karma/karma-debug.html b/packages/angular_devkit/build_angular/src/webpack/plugins/karma/karma-debug.html
index 0f13c288aa6a..f348daf64352 100644
--- a/packages/angular_devkit/build_angular/src/webpack/plugins/karma/karma-debug.html
+++ b/packages/angular_devkit/build_angular/src/webpack/plugins/karma/karma-debug.html
@@ -32,8 +32,8 @@
// All served files with the latest timestamps
%MAPPINGS%
-
-
+
+
%SCRIPTS%
diff --git a/tests/legacy-cli/e2e/tests/test/test-jasmine-clock.ts b/tests/legacy-cli/e2e/tests/test/test-jasmine-clock.ts
new file mode 100644
index 000000000000..fa24baaf5b27
--- /dev/null
+++ b/tests/legacy-cli/e2e/tests/test/test-jasmine-clock.ts
@@ -0,0 +1,37 @@
+import { ng } from '../../utils/process';
+import { writeFile } from '../../utils/fs';
+
+export default async function () {
+ await writeFile(
+ 'src/app/app.component.spec.ts',
+ `
+ import { TestBed } from '@angular/core/testing';
+ import { RouterTestingModule } from '@angular/router/testing';
+ import { AppComponent } from './app.component';
+
+ describe('AppComponent', () => {
+ beforeAll(() => {
+ jasmine.clock().install();
+ });
+
+ afterAll(() => {
+ jasmine.clock().uninstall();
+ });
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ imports: [RouterTestingModule],
+ declarations: [AppComponent],
+ }).compileComponents();
+ });
+
+ it('should create the app', () => {
+ const fixture = TestBed.createComponent(AppComponent);
+ expect(fixture.componentInstance).toBeTruthy();
+ });
+ });
+ `,
+ );
+
+ await ng('test', '--watch=false');
+}