cap-bookshop-typescript
cap-bookshop-typescript copied to clipboard
Add Unit Test Sample
Hi, First of all, thanks for your great work. This project help me a lot to have a prototype of Typescript project for CAP. If possible, a sample unit test like the one in Cloud-Cap-Sample would be great! (https://github.com/SAP-samples/cloud-cap-samples/tree/master/test) Recently, I saw SAP CAP begin to support TS through TS-Node, will it be the new direction of SAP CAP?
Hi
cds-ts is intended to implement the handlers in the same way and methodology as in JavaScript, but only in TypeScript. (Filenames equal to the name of the service, ...).
cds2types creates interfaces for the types and entities from the cds definition and is primarily for being able to code against a typed representation of the entities. cds2types and cds-ts can be combined nicely.
cds-routing-handlers goes one step further by changing the way handlers can be implemented. cds-routing-handlers gives the possibility to implement the handlers in a class based declarative notation. I find this to be more concise and cleaner especially for larger projects.
The question is not what is the future direction, but what you prefer.
PS: We are in contact with SAP regarding the future of cds-ts and cds2types / cds-routing-handlers.