Skip to content

gardnor/singuTest

Repository files navigation

Nest Logo

Description

This is a Node.js application built using the NestJS framework, following clean architecture principles, SOLID principles, and the design pattern "Dependency Injection (DI)" to ensure maintainability and scalability.

Prerequisites

Before running the application, ensure you have the following installed:

  • Node.js (version 20.16.0)
  • npm (version 10.8.1)
  • MongoDB (Ensure MongoDB is running locally or use a remote connection)

Installation

1. Clone the repository:

    git clone [email protected]:gardnor/singuTest.git
    cd <repository-directory>

2. Install the dependencies:

    npm install

3. Set up environment variables:

  • Copy the .env.example file and rename it to .env.
  • Update the MONGO_URI variable in the .env file with your MongoDB connection string (you can use mine, it is in .env.example).

Development watch mode

1. Run in terminal

    npm run start:dev

a. The application will run by default on http://localhost:3000.

API Documentation

After running the application, you can access the API documentation generated by Swagger at:

http://localhost:3000/api

This documentation provides details on all available endpoints, request parameters, and response formats.

Tests

1. To run the tests, use the following commands:

    npm run test
    npm run test:e2e
    npm run test:cov

Unit Tests

  • Controllers: Verify that the API endpoints respond correctly and handle requests as expected.
  • Services: Test business logic to ensure that rules and processes are applied correctly.
  • Repositories: Validate interactions with the database and confirm that data is persisted and retrieved correctly.

End-to-End (e2e) Tests

  • Objective: Test the complete application flow to ensure that functionalities work correctly from start to finish, including interaction with the database and endpoint responses.

Test Configuration

  • Framework: Jest
  • Test Environment: Node.js
  • e2e Testing Tool: Supertest

Stay in touch

License

Nest is MIT licensed.

About

Test case with clean arch, solid and patterns

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published