jeudi 3 décembre 2020

Running tests on Typescript source code Versus the generated JavaScript

In a web project where TypeScript is used to program the entire application, front-end and back-end, and as well as tests. Then it is all compiled and deployed as JavaScript;

What is desirable to run the tests on during deployment. Does it make more sense to run it on the TypeScript source code directly? Or does it make more sense to run it on the resulting generated JavaScript (which is later deployed to server)

Remember that depending on which it is run on, it has some minor implications on things like code-coverage reporting for example.

One school of thought is to run it on the TypeScript source code, because that is what the programmer is producing and has direct control over.

On the other hand, it is the JavaScript generated code that ultimately runs after it has been deployed.

Is there an accepted pattern to this?

Aucun commentaire:

Enregistrer un commentaire