Skip to content

Export angular test utils as @a2ui/angular/testing#1737

Open
josemontespg wants to merge 7 commits into
a2ui-project:mainfrom
josemontespg:export-test-utils
Open

Export angular test utils as @a2ui/angular/testing#1737
josemontespg wants to merge 7 commits into
a2ui-project:mainfrom
josemontespg:export-test-utils

Conversation

@josemontespg

@josemontespg josemontespg commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

This PR exposes the Angular test utilities under the secondary entry point @a2ui/angular/v0_9/testing and creates a root-level alias @a2ui/angular/testing for them. It also refactors the 18 basic component spec files in src/v0_9 to use the new @a2ui/angular/testing alias.

This was motivated by 1P code using deep imports to depend on these test utils. The test utils are generally useful not just for 1P, so I'm exporting them with clean aliases here.

Using @a2ui/angular/testing naming following the existing @angular/core/testing alias

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the Angular renderer's test files to import testing utilities from the newly created @a2ui/angular/testing package instead of using relative paths. It introduces the testing package structure, including ng-package.json, public-api.ts, and test-utils.ts, and updates the TypeScript configuration paths accordingly. Feedback on the changes points out an incorrect relative path to node_modules in the newly added ng-package.json file, which should be corrected to point to the proper directory level.

Comment thread renderers/angular/src/v0_9/testing/ng-package.json Outdated
Comment thread renderers/angular/src/v0_9/testing/test-utils.ts
@josemontespg josemontespg changed the title test: export angular test utils as secondary entry point and alias test: export angular test utils as @a2ui/angular/testing Jun 23, 2026
@josemontespg josemontespg changed the title test: export angular test utils as @a2ui/angular/testing Export angular test utils as @a2ui/angular/testing Jun 23, 2026
@josemontespg josemontespg requested a review from ditman June 23, 2026 19:44
@josemontespg

Copy link
Copy Markdown
Collaborator Author

Agent: Add a note to the Angular changelog about this

@ditman ditman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have unusually strong feelings about not export * from the public-api, and instead be explicit with what we export from there. That way we can have much tighter control over what we're actually exporting publically, and it's easier to prevent unintentionally exporting things.

Within the library we can use export * as much as we want, but the public API should be explicit if we can.

Comment thread renderers/angular/src/v0_9/testing/public-api.ts Outdated
Comment thread renderers/angular/src/v0_9/testing/test-utils.ts
Comment thread renderers/angular/testing
@josemontespg

Copy link
Copy Markdown
Collaborator Author

🤖 I have added a note to the Angular changelog under the Unreleased section.

@josemontespg josemontespg requested a review from ditman June 24, 2026 17:19
@josemontespg

Copy link
Copy Markdown
Collaborator Author

I addressed the comments. Keeping the symlink and inline jasmine type. Please take a look when you can. Thanks!

@ditman ditman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding explicit exports to the public-api!

@ditman

ditman commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Note: the broken docs presubmit check is a flake. I've seen that link fail many times already. I'll add it to the ignored section, it's very annoying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants