Advantages of unit testing—with examples in Jasmine