Skip to content

Testing

Testing is a crucial step in building scalable, maintainable, and trustworthy applications. Testing should never be avoided, even in the face of short deadlines or strong pressure from the product team. Nowadays, there are numerous awesome tools available that make it easy to test your code and provide a great developer experience.

In this series of testing exercises, we will learn and master Testing Library and Cypress Component Testing that simplifies DOM manipulation for testing any Angular component.

The benefits of using Testing Library or Cypress Component Testing are to test your component as a black box. You will only interact with what the user can do on the UI. However, the difference with end-to-end tests is that the backend is mocked, which makes the tests faster and more maintainable. The goal is to mock as little as possible to test your component at a higher level than unit testing, which will make refactoring easier. Within a real application, integration tests are the tests you will write the most. Learning how to write them will make your application more robust and more maintainable.

Here is a series of 8 challenges that you can take in any order.

🟒 HarnessLearn how to test using Angular CDK Component harnesses
🟒 CheckboxLearn how to debug your tests using Testing Library on a simple checkbox application
🟠 RouterLearn how to test the routed components
🟠 Nested ComponentsLearn how to test nested components
🟠 Input OutputLearn how to test inputs and outputs
🟠 ModalLearn how to test a modal component
🟠 Harness CreationLearn how to create harness on your own components
πŸ”΄ Real-life ApplicationLearn how to write a series of test for a real-life applications