mercredi 18 février 2015

How to structure client side unit test files

Currently I am implementing client side unit testing using karma jasmine for a big project I've been working on.


I'm looking for a best practice to structure our testing code in a Visual Studio solution. The project has over 50 different js files that should all have their own unit test script. Also the directory structure of the code goes up to 8 directories deep. I've thought about a couple of different approaches to structure the unit tests files.



  1. Unit test files in the same directory as the code files that should be tested

  2. Unit test files in a subdirectory "tests" in each of the directories with code

  3. A directory called "tests" in the root of the project with the same directory structure as the actual code

  4. A new project with a directory with the same directory structure as the actual code


What is a good way to structure my client side unit tests files in a big project and still keep it maintainable and "clean"?


Aucun commentaire:

Enregistrer un commentaire