How drmoreira/angular-unit-tests works
This is an Angular 20 demo for practical unit-testing patterns, with a small runtime that renders a property-driven component and an asynchronous mock commit list. The graph shows the runtime flow and the documented component/service testing focus; test files are present, but their contents were not excerpted, so their specific setups and dependency-mocking relationships are not inferred.
Main entry points: child-b-api.ts Mock commit API · main.ts Bootstrap · app.ts Demo shell · child-b.ts Commit display
Components 13
Application entry
- Bootstrap
src/main.ts - App configuration
src/app/app.config.ts - English translations
public/i18n/en.json
UI demonstrations
- Demo shell
src/app/app.ts - Profile display
src/app/child-a/child-a.ts - Commit display
src/app/child-b/child-b.ts
Request data
- Mock commit API
src/app/child-b/services/child-b-api.ts - Request model
src/app/shared/models/request-model.ts - Commit model
src/app/shared/models/commit-model.ts - Request states
src/app/shared/enums/request-state-enum.ts
Testing examples
- Component tests
src/app/child-a/child-a.spec.ts - Service tests
src/app/child-b/services/child-b-api.spec.ts
Other components
- Browser
Connections 11
- Browser → Bootstrap: starts app
src/main.ts - Bootstrap → App configuration: provides config
src/main.ts - Bootstrap → Demo shell: bootstraps
src/main.ts - Demo shell → Profile display: renders
src/app/app.ts - Demo shell → Commit display: renders
src/app/app.ts - Commit display → Mock commit API: requests commits
src/app/child-b/child-b.ts - Mock commit API → Request model: returns request
src/app/child-b/services/child-b-api.ts - Mock commit API → Commit model: returns commits
src/app/child-b/services/child-b-api.ts - Mock commit API → Request states: sets state
src/app/child-b/services/child-b-api.ts - Commit display → Request states: renders by state
src/app/child-b/child-b.ts - App configuration → English translations: loads language file
src/app/app.config.ts