vendredi 12 juin 2020

Why do we write an extra test folder for programming languages that can also run tests in the src folder?

I was wondering why in many typescript tutorials where it was also about testing there was always an extra test folder created ?

Isn't it easier to write the test directly next to the class e.g. like this: (Not possible in every language, but I mean this example only for the languages where it is possible. e.g. typescript)

src/folder/
 Class.*
 Class.test.*

It's even easier for big projects, because you don't have to scroll down so far in the IDE to get to the test, but have it right next to it.

But I see very often, that a test folder is always created extra like this:

src/folder/
 Class.*
test/folder/
 Class.test.*

(In the end, everyone can decide for himself how he wants to design his project, but I can't get the question out of my head)

If possible, write about how you organize your tests, whether you are satisfied with the test organization and whether you were able to decide for yourself how you want to organize your tests.

Aucun commentaire:

Enregistrer un commentaire