Tests
September 9, 2025 ยท View on GitHub
Table of Contents
Unit Tests
Unit tests are located at the same level as the file of the function being tested (e.g., a service file).
File Naming Convention: <name>.spec.ts
npm run test
E2E Tests
E2E (End-to-End) test files are located in a module-specific subdirectory within the test/ directory.
File Location: test/<module>/
File Naming Convention: <name>.e2e-spec.ts
npm run test:e2e
Tests in Docker
These commands execute the E2E tests within a Dockerized environment. Therefore, the test files follow the same structure and naming conventions as described in the E2E Tests section.
For relational database
npm run test:e2e:relational:docker
For document database
npm run test:e2e:document:docker
Load Tests
Load tests are designed to evaluate the performance and stability of the application under various levels of traffic.
File Location and Naming Convention
Each module has its own dedicated load testing files, organized within the load-test directory:
- Load Test Scenarios:
load-test/<module>/<module>-load-test.yml - Load Test Reports:
load-test/<module>/<module>-load-test-report.md
For example, for the users module:
load-test/users/users-load-test.ymlload-test/users/users-load-test-report.md
Prerequisites and Setup
To set up and run load tests, you need to install Artillery and configure your test scenarios. For detailed instructions on installation, setup, and how to run load tests, please refer to the Artillery Load Testing documentation.
Previous: File uploading
Next: Load Testing