cgross / generator-cg-angular

Yeoman generator for Enterprise Angular projects.
MIT License
592 stars 198 forks source link

Why do the unit tests live in their own directory? #3

Closed neonsamurai closed 10 years ago

neonsamurai commented 11 years ago

For modularity's sake I think putting tests along with what they test (directive, partial, filter etc...) is better because then these components are truly drop ins. Furthermore you don't have to jump directories so much, everything is in one place.

sbgoodm commented 11 years ago

One thing to consider is that you don't want to deploy the unit tests to production, so the build/minify step would need to be modified to account for stripping out test code from the optimized JS output.

bwinchester commented 11 years ago

Tests? We don't need no stinking tests!

cgross commented 11 years ago

I actually debated this myself when creating the initial structure. I think its a fair question and I'm leaning towards putting the tests in the component's directory now rather than a separate tests dir.

@sbgoodm Actually the way the build works, it reads the script tags from your index.html to determine both what Javascript to combine and the order in which to combine them. So that wouldnt be an issue. Doing it that way was something I felt strongly about. So there was only one place to learn the "truth" of what files your app was using.

@neonsamurai I will probably change this at some point but I don't have alot of time right now. I'm open to pull requests.