Tsc command

https://www.codecademy.com/courses/learn-typescript/lessons/introduction-to-typescript/exercises/type-shapes

If I understand correctly: every .ts file will be compiled to a .js file, but then it won’t have TS advantages and properties if you run it using node. So if I want, lets say, to get an explanation for an error, that only TS is capable of, then I have to run ‘tsc’ command, instead of ‘node fileName.js’ as on the compiled version of the same file? Please correct me if im wrong

Yes, typescript does not and cannot catch anything at run-time.

If you want to have additional coverage you might consider adding tests (unit, integration, end to end depending on your needs).

1 Like

I’m learning it for automation testing, I’ll be writing my tests in playwright

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.