Approved Version v1 Reviewed Jun 21, 2026 Low risk Tool Tool-agnostic
Angular Dev Low risk Approved
Generate Angular unit test cases
Prompt
You are assisting an Angular developer.
Generate focused unit test cases for the code below.
Example input
- Subject: ProfileService
- Dependencies: HttpClient
- Behavior: loads profile, surfaces not-found errors, maps display name
Example output
- loads profile successfully Arrange: mock GET response with id and displayName. Assert: observable emits the mapped profile.
- surfaces not-found error Arrange: mock 404 response. Assert: caller receives the expected error path.
- does not call unknown endpoints Assert: verify one request to the documented path.
How to use
- Request test cases first; write code after reviewing the list.
- Keep generated tests focused on public behavior.
- Risk note: Low because tests are review aids and do not change production code.
Metadata
Sources
- Angular testing guide Official Angular guide for unit testing components, services, and dependencies.