Skip to content

Commit 0505f95

Browse files
committed
fix(@angular/build): allow unit-test progress option passthrough for building
The experimental unit-test builder will now pass through the `progress` option to the build system if present. By default the `progress` value of the build target will be used.
1 parent cf722f5 commit 0505f95

File tree

5 files changed

+9
-2
lines changed

5 files changed

+9
-2
lines changed

goldens/public-api/angular/build/index.api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ export type UnitTestBuilderOptions = {
223223
debug?: boolean;
224224
exclude?: string[];
225225
include?: string[];
226+
progress?: boolean;
226227
providersFile?: string;
227228
reporters?: string[];
228229
runner: Runner;

packages/angular/build/src/builders/unit-test/builder.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ export async function* execute(
191191
...runnerBuildOptions,
192192
watch: normalizedOptions.watch,
193193
tsConfig: normalizedOptions.tsConfig,
194+
progress: normalizedOptions.buildProgress ?? buildTargetOptions.progress,
194195
} satisfies ApplicationBuilderInternalOptions;
195196

196197
yield* runBuildAndTest(executor, applicationBuildOptions, context, finalExtensions);

packages/angular/build/src/builders/unit-test/options.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export async function normalizeOptions(
3333
const buildTargetSpecifier = options.buildTarget ?? `::development`;
3434
const buildTarget = targetFromTargetString(buildTargetSpecifier, projectName, 'build');
3535

36-
const { tsConfig, runner, reporters, browsers } = options;
36+
const { tsConfig, runner, reporters, browsers, progress } = options;
3737

3838
return {
3939
// Project/workspace information
@@ -57,6 +57,7 @@ export async function normalizeOptions(
5757
}
5858
: undefined,
5959
tsConfig,
60+
buildProgress: progress,
6061
reporters,
6162
browsers,
6263
watch: options.watch ?? isTTY(),

packages/angular/build/src/builders/unit-test/runners/karma/executor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class KarmaExecutor implements TestExecutor {
5252
include: unitTestOptions.include,
5353
exclude: unitTestOptions.exclude,
5454
sourceMap: buildTargetOptions.sourceMap,
55-
progress: buildTargetOptions.progress,
55+
progress: unitTestOptions.buildProgress ?? buildTargetOptions.progress,
5656
watch: unitTestOptions.watch,
5757
poll: buildTargetOptions.poll,
5858
preserveSymlinks: buildTargetOptions.preserveSymlinks,

packages/angular/build/src/builders/unit-test/schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@
106106
"type": "string"
107107
},
108108
"description": "A list of global setup and configuration files that are included before the test files. The application's polyfills are always included before these files. The Angular Testbed is also initialized prior to the execution of these files."
109+
},
110+
"progress": {
111+
"type": "boolean",
112+
"description": "Log progress to the console while building. Defaults to the build target's progress value."
109113
}
110114
},
111115
"additionalProperties": false,

0 commit comments

Comments
 (0)