Unit Testing Best Practices in AngularJS
What should I be testing and when should I be writing tests? A frontend development article by Andy Shora
Why do you need to write tests?
Because you’re not Chuck Norris. Chuck Norris’ code tests itself, and it always passes, with 0ms execution time.
Ok, seriously, writing tests feels good! I think it’s essential that you learn to love the feeling of having a water-tight app. One which you know is not going to, you know, suddenly die the moment someone else starts making changes.
It might just be me, but when you’ve written a nice function, and you’ve verified it works the way it should, it feels solid. You see green ticks on a command line, all tests passed. BOOM! You’ve just written some of the most solid, reliable code that’s ever been written!