Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

AutomatedTesting

dainank edited this page May 9, 2023 · 2 revisions

Automated Testing

The core reason for automated testing is to prevent having to manually test everything and in the process save precious development time.

Tools

  • Jest - A tool for automated testing of JavaScript code:
    • most popular testing tool for JavaScript
    • easy setup with minimal configuration
    • fast and supports live reloading
    • config file created with npx jest --init
  • Playwright - A tool for automated testing of web pages.

Types of Testing

  • Unit - Tests isolated code and individual functions.
  • Integration - Tests whole microservices.
  • End-To-End - Tests groups of microservices and/or the entire application including the front end.

End Goal

Automated testing together with a CI/CD pipeline will function like an early warning system that prevents problems going into production and impacting customers.

Unit Testing Microservices

Testing a single unit of code (function/aspect within a function) in isolation to the rest of the src code.

The isolation can be achieved through mocking other dependencies, allowing our unit tests to focus on a specific test and run lightning fast.