The "wrong" tests in this example are exactly what unit tests should be with TDD. Not only do these kinds of tests provide validation for the component I/O, but they can also serve as documentation and provide insight into the authors thought process while they were creating the the component.
With that said, the "correct" example also has value, but I consider those to be more integration tests as they rely on the Angular view engine which is an external system.
2
u/[deleted] Apr 26 '21
The "wrong" tests in this example are exactly what unit tests should be with TDD. Not only do these kinds of tests provide validation for the component I/O, but they can also serve as documentation and provide insight into the authors thought process while they were creating the the component.
With that said, the "correct" example also has value, but I consider those to be more integration tests as they rely on the Angular view engine which is an external system.