feat: add .spec.ts generation for models, mappers, repositories and use-cases

Add 4 new Mustache templates for generating unit test specs:
- model-entity.spec.mustache: tests instantiation, property setting, mock builder
- mapper.spec.mustache: tests per-property DTO→Entity mapping, instanceof, all fields
- api.repository.impl.spec.mustache: tests HTTP method, response mapping, error propagation
- api.use-cases.impl.spec.mustache: tests repository delegation, observable forwarding

Generator changes:
- Add uppercaseHttpMethod to TagOperation for spec HTTP assertions
- Add testValue to TagOperationParam for auto-generated test arguments
- Add resolveTestParamValue utility for primitive/complex type test literals
- Add specs counter to GeneratedCount and GenerationReport
- Wire 4 new renderTemplate calls in schema and tag loops
- Update report generator to count .spec.ts files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
didavila
2026-03-26 10:52:58 +01:00
parent 05a58c4254
commit 463626da0c
8 changed files with 343 additions and 5 deletions

View File

@@ -96,6 +96,7 @@ export interface TagOperationParam {
description: string;
required: boolean;
'-last': boolean;
testValue?: string;
}
/**
@@ -107,6 +108,7 @@ export interface TagOperation {
summary: string;
notes: string;
httpMethod: string;
uppercaseHttpMethod: string;
path: string;
allParams: TagOperationParam[];
hasQueryParams: boolean;