feat: enhance DTO mock generation with dynamic import paths and mock value checks
This commit is contained in:
@@ -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}}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user