diff --git a/packages/angular_devkit/build_angular/src/builders/browser/specs/aot_spec.ts b/packages/angular_devkit/build_angular/src/builders/browser/specs/aot_spec.ts deleted file mode 100644 index 87d46e9a91..0000000000 --- a/packages/angular_devkit/build_angular/src/builders/browser/specs/aot_spec.ts +++ /dev/null @@ -1,65 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import { Architect } from '@angular-devkit/architect'; -import { BrowserBuilderOutput } from '@angular-devkit/build-angular'; -import { join, logging, normalize, virtualFs } from '@angular-devkit/core'; -import { lastValueFrom } from 'rxjs'; -import { createArchitect, host } from '../../../testing/test-utils'; - -describe('Browser Builder AOT', () => { - const targetSpec = { project: 'app', target: 'build' }; - let architect: Architect; - - beforeEach(async () => { - await host.initialize().toPromise(); - architect = (await createArchitect(host.root())).architect; - }); - afterEach(async () => host.restore().toPromise()); - - it('works', async () => { - const overrides = { aot: true }; - - const run = await architect.scheduleTarget(targetSpec, overrides); - const output = (await run.result) as BrowserBuilderOutput; - - expect(output.success).toBeTrue(); - - const fileName = join(normalize(output.outputs[0].path), 'main.js'); - const content = virtualFs.fileBufferToString( - await lastValueFrom(host.read(normalize(fileName))), - ); - expect(content).toContain('AppComponent_Factory'); - - await run.stop(); - }); - - it('shows error when component stylesheet contains SCSS syntax error', async () => { - const overrides = { - aot: true, - }; - - host.replaceInFile('src/app/app.component.ts', 'app.component.css', 'app.component.scss'); - - host.writeMultipleFiles({ - 'src/app/app.component.scss': ` - .foo { - `, - }); - - const logger = new logging.Logger(''); - const logs: string[] = []; - logger.subscribe((e) => logs.push(e.message)); - - const run = await architect.scheduleTarget(targetSpec, overrides, { logger }); - const output = await run.result; - expect(output.success).toBe(false); - expect(logs.join()).toContain('expected "}".'); - await run.stop(); - }); -}); diff --git a/packages/angular_devkit/build_angular/src/builders/browser/specs/no-entry-module_spec.ts b/packages/angular_devkit/build_angular/src/builders/browser/specs/no-entry-module_spec.ts deleted file mode 100644 index edb9e1a0d3..0000000000 --- a/packages/angular_devkit/build_angular/src/builders/browser/specs/no-entry-module_spec.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import { Architect } from '@angular-devkit/architect'; -import { browserBuild, createArchitect, host } from '../../../testing/test-utils'; - -describe('Browser Builder no entry module', () => { - const target = { project: 'app', target: 'build' }; - let architect: Architect; - - beforeEach(async () => { - await host.initialize().toPromise(); - architect = (await createArchitect(host.root())).architect; - }); - afterEach(async () => host.restore().toPromise()); - - it('works', async () => { - // Remove the bootstrap but keep a reference to AppModule so the import is not elided. - host.replaceInFile('src/main.ts', /platformBrowserDynamic.*?bootstrapModule.*?;/, ''); - host.appendToFile('src/main.ts', 'console.log(AppModule);'); - - await browserBuild(architect, host, target, { baseHref: '/myUrl' }); - }); -});