Chapter 5. Testing Patterns
This chapter will cover testing patterns that ensure our code is easy to maintain. With these patterns, you will learn how to implement regression testing—a method to identify if the new code breaks the old code before the code goes into production. Building tests is crucial to maintain code and collaborate with others. You will learn the following topics:
- Behavior tests
- Unit tests
Testing in Meteor is still under heavy development, but the functions that we will cover are basic and are unlikely to change.
Behavior tests
Behavior tests are known as end-to-end tests too. The purpose of a behavior test is simple: it makes sure that a feature of the project is working. A feature refers to the business logic behind the application. For example, a feature of our current project is viewing a list of products in our landing page. Another feature is the ability to add a variable quantity of products to the order.
To run behavior tests in Meteor, we essentially...