Skip to content
angular challenges logo Angular Challenges

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 Angular Testing Library and Cypress Component Testing that simplifies DOM manipulation for testing any Angular component.

The benefits of using Angular 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.

🟢 Harness Learn how to test using Angular CDK Component harnesses
🟢 Checkbox Learn how to debug your tests using [Angular Testing Library](https://testing-library.com/) on a simple checkbox application
🟠 Router Learn how to test the routed components
🟠 Nested Components Learn how to test nested components
🟠 Input Output Learn how to test inputs and outputs
🟠 Modal Learn how to test a modal component
🟠 Harness Creation Learn how to create harness on your own components
🔴 Real-life Application Learn how to write a series of test for a real-life applications

Contributors

Thanks to all the contributors who have helped make this documentation better!

  • tomalaforge
  • LMFinney