feat: enhance DTO mock generation with dynamic import paths and mock value checks

This commit is contained in:
2026-03-27 15:40:33 +01:00
parent e0446d4939
commit 16ef1ce3e3
3 changed files with 20 additions and 7 deletions

View File

@@ -11,6 +11,7 @@ describe('{{classname}}', () => {
});
{{#vars}}
{{#hasMockValue}}
it('should allow setting {{name}}', () => {
const model = new {{classname}}();
const expected = mock{{classname}}Model();
@@ -19,13 +20,16 @@ describe('{{classname}}', () => {
expect(model.{{name}}).toBe(expected.{{name}});
});
{{/hasMockValue}}
{{/vars}}
it('should build a valid model from mock', () => {
const model = mock{{classname}}Model();
expect(model).toBeInstanceOf({{classname}});
{{#vars}}
{{#hasMockValue}}
expect(model.{{name}}).toBeDefined();
{{/hasMockValue}}
{{/vars}}
});
});