diff --git a/packages/angular/build/src/builders/unit-test/tests/behavior/coverage-ignore-comments_spec.ts b/packages/angular/build/src/builders/unit-test/tests/behavior/coverage-ignore-comments_spec.ts
new file mode 100644
index 000000000000..d04c9aa7e690
--- /dev/null
+++ b/packages/angular/build/src/builders/unit-test/tests/behavior/coverage-ignore-comments_spec.ts
@@ -0,0 +1,143 @@
+/**
+ * @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 { execute } from '../../index';
+import {
+ BASE_OPTIONS,
+ describeBuilder,
+ UNIT_TEST_BUILDER_INFO,
+ setupApplicationTarget,
+} from '../setup';
+
+describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => {
+ describe('Behavior: "coverage ignore comments"', () => {
+ beforeEach(async () => {
+ setupApplicationTarget(harness);
+ });
+
+ it('should respect istanbul ignore next comments when computing coverage', async () => {
+ harness.useTarget('test', {
+ ...BASE_OPTIONS,
+ coverage: true,
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ coverageReporters: ['json'] as any,
+ });
+
+ harness.writeFile(
+ 'src/app/app.component.ts',
+ `
+ import { Component } from '@angular/core';
+
+ @Component({
+ selector: 'app-root',
+ template: '
hello
',
+ standalone: true,
+ })
+ export class AppComponent {
+ title = 'app';
+
+ /* istanbul ignore next */
+ untestedFunction() {
+ return false;
+ }
+ }
+ `,
+ );
+
+ harness.writeFile(
+ 'src/app/app.component.spec.ts',
+ `
+ import { AppComponent } from './app.component';
+
+ describe('AppComponent', () => {
+ it('should create', () => {
+ const comp = new AppComponent();
+ expect(comp).toBeTruthy();
+ });
+ });
+ `,
+ );
+
+ const { result } = await harness.executeOnce();
+ expect(result?.success).toBeTrue();
+ harness.expectFile('coverage/test/coverage-final.json').toExist();
+
+ const coverageMap = JSON.parse(harness.readFile('coverage/test/coverage-final.json'));
+ const appComponentPath = Object.keys(coverageMap).find((p) => p.includes('app.component.ts'));
+ expect(appComponentPath).toBeDefined();
+
+ const appComponentCoverage = coverageMap[appComponentPath!];
+
+ const statementCounts = Object.values(appComponentCoverage.s) as number[];
+ const hasUncoveredStatements = statementCounts.some((count) => count === 0);
+ expect(hasUncoveredStatements)
+ .withContext('There should be no uncovered statements as the uncalled function was ignored')
+ .toBeFalse();
+ });
+
+ it('should respect v8 ignore next comments when computing coverage', async () => {
+ harness.useTarget('test', {
+ ...BASE_OPTIONS,
+ coverage: true,
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ coverageReporters: ['json'] as any,
+ });
+
+ harness.writeFile(
+ 'src/app/app.component.ts',
+ `
+ import { Component } from '@angular/core';
+
+ @Component({
+ selector: 'app-root',
+ template: 'hello
',
+ standalone: true,
+ })
+ export class AppComponent {
+ title = 'app';
+
+ /* v8 ignore next */
+ untestedFunction() {
+ return false;
+ }
+ }
+ `,
+ );
+
+ harness.writeFile(
+ 'src/app/app.component.spec.ts',
+ `
+ import { AppComponent } from './app.component';
+
+ describe('AppComponent', () => {
+ it('should create', () => {
+ const comp = new AppComponent();
+ expect(comp).toBeTruthy();
+ });
+ });
+ `,
+ );
+
+ const { result } = await harness.executeOnce();
+ expect(result?.success).toBeTrue();
+ harness.expectFile('coverage/test/coverage-final.json').toExist();
+
+ const coverageMap = JSON.parse(harness.readFile('coverage/test/coverage-final.json'));
+ const appComponentPath = Object.keys(coverageMap).find((p) => p.includes('app.component.ts'));
+ expect(appComponentPath).toBeDefined();
+
+ const appComponentCoverage = coverageMap[appComponentPath!];
+
+ const statementCounts = Object.values(appComponentCoverage.s) as number[];
+ const hasUncoveredStatements = statementCounts.some((count) => count === 0);
+ expect(hasUncoveredStatements)
+ .withContext('There should be no uncovered statements as the uncalled function was ignored')
+ .toBeFalse();
+ });
+ });
+});