Closed GoldSucc closed 2 weeks ago
Tested, seems to fix the issue.
Can you provide more context on the issue?
@chgeo open the mentioned issue #382
@chgeo when cds definition (.cds file) contains only events/operations it generates type without import which is incorrect ts file. tsc produces type errors indeed because no import is present. to get this error, event/operation should use type like Timestamp (something that comes from . like __.CdsTimestamp).
@chgeo when cds definition (.cds file) contains only events/operations it generates type without import which is incorrect ts file. tsc produces type errors indeed because no import is present. to get this error, event/operation should use type like Timestamp (something that comes from . like __.CdsTimestamp).
I see. So I will add a test for that before merging. Alternatively, you can give it a try. See our testing guide for this. Lately, we added compilation tests which are easier to write than the AST ones.
@chgeo I have some experience with code generation and syntax trees so I decided to implement tests in AST. Committed changes with tests.
Fixes https://github.com/cap-js/cds-typer/issues/382 (event import error).