Writing DAMP tests
Any seasoned developer will almost certainly be familiar with the Don't Repeat Yourself (DRY) programming principle. When architecting production applications, the DRY principle promotes improved code maintainability by ensuring that there is no logic duplication (or as little as feasibly possible) in order to allow efficient system additions and modifications.
Descriptive And Meaningful Phrases (DAMP) on the other hand promotes improved code readability by ensuring that there is not too much abstraction to cause the code to be difficult to understand, even if it is at the expense of introducing redundancy. Jasmine encourages this by providing a Domain Specific Language (DSL) syntax, which approximates how humans would linguistically declare and reason about how the program should work.
How to do it…
The following tests are a sample of unit tests from the Writing basic unit tests recipe, presented here unchanged:
it('should display invalid handle for insufficient characters...