herbs-cli icon indicating copy to clipboard operation
herbs-cli copied to clipboard

Tests for entities

Open dalssoft opened this issue 4 years ago • 6 comments

The only test currently being generated (from new or update command) is use case tests.

Since entities also can (and should) have logic, they should have tests for entities as well.

ex: \src\domain\entities\user.js \src\domain\entities\user.test.js

dalssoft avatar Dec 18 '21 14:12 dalssoft

@dalssoft This test is for entities generated by the CLI? When you generate a new entity, It does not have logic yet.

maikmb avatar Jul 05 '22 14:07 maikmb

This issue is pre-spec/aloe but the idea remains valid. In order to implement this issue, first it is necessary to add a spec to entities on aloe.

Once we have this feature there we could have a generated spec files to each entity or at least for the first entity (User) as an example

dalssoft avatar Jul 05 '22 22:07 dalssoft

Yes, I agree! We can have at least one user.spec file in the herbs-cli template.

maikvortx avatar Jul 06 '22 00:07 maikvortx

I can work on this issue.

RafaelStutz avatar Jul 12 '22 00:07 RafaelStutz

@RafaelStutz are you still working on this?

italojs avatar Oct 05 '22 12:10 italojs

FYI, CLI can now run specs without use case metadata: https://github.com/herbsjs/herbs-cli/issues/169

With that, it is just a matter of creating templates for the entities.

dalssoft avatar Nov 15 '22 19:11 dalssoft