Thanks to visit codestin.com
Credit goes to github.com

Skip to content

test(@angular/build): reset project metadata before each run #30571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions modules/testing/builder/src/builder-harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ export class BuilderHarness<T> {
return join(getSystemPath(this.host.root()), path);
}

resetProjectMetadata(): void {
this.projectMetadata = DEFAULT_PROJECT_METADATA;
}

useProject(name: string, metadata: Record<string, unknown> = {}): this {
if (!name) {
throw new Error('Project name cannot be an empty string.');
Expand Down
6 changes: 5 additions & 1 deletion modules/testing/builder/src/jasmine-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ export function describeBuilder<T>(
});

describe(options.name || builderHandler.name, () => {
beforeEach(() => host.initialize().toPromise());
beforeEach(async () => {
harness.resetProjectMetadata();

await host.initialize().toPromise();
});

afterEach(() => host.restore().toPromise());

Expand Down
2 changes: 1 addition & 1 deletion packages/angular/build/src/utils/worker-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class WorkerPool extends Piscina {
constructor(options: WorkerPoolOptions) {
const piscinaOptions: WorkerPoolOptions = {
minThreads: 1,
idleTimeout: 1000,
idleTimeout: 4_000,
// Web containers do not support transferable objects with receiveOnMessagePort which
// is used when the Atomics based wait loop is enable.
atomics: process.versions.webcontainer ? 'disabled' : 'sync',
Expand Down
Loading