Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 917af12

Browse filesBrowse files
committed
fix(@angular/build): use date/time based output path for vitest unit-test
The output directory name for the unit-test code when using the experimental `unit-test` builder with the `vitest` runner will now use a value based on the date and time of test execution instead of only a random UUID. This value improves the discoverability of a test execution when multiple have been performed.
1 parent 8f860cc commit 917af12
Copy full SHA for 917af12

File tree

Expand file treeCollapse file tree

1 file changed

+8
-1
lines changed
Filter options
  • packages/angular/build/src/builders/unit-test
Expand file treeCollapse file tree

1 file changed

+8
-1
lines changed

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

Copy file name to clipboardExpand all lines: packages/angular/build/src/builders/unit-test/builder.ts
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export async function* execute(
113113
buildTargetOptions.polyfills.push('zone.js/testing');
114114
}
115115

116-
const outputPath = path.join(context.workspaceRoot, 'dist/test-out', randomUUID());
116+
const outputPath = path.join(context.workspaceRoot, generateOutputPath());
117117
const buildOptions: ApplicationBuilderInternalOptions = {
118118
...buildTargetOptions,
119119
watch: normalizedOptions.watch,
@@ -343,3 +343,10 @@ function setupBrowserConfiguration(
343343

344344
return { browser };
345345
}
346+
347+
function generateOutputPath(): string {
348+
const datePrefix = new Date().toISOString().replaceAll(/[-:.]/g, '');
349+
const uuidSuffix = randomUUID().slice(0, 8);
350+
351+
return path.join('dist', 'test-out', `${datePrefix}-${uuidSuffix}`);
352+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.