Giter Club home page Giter Club logo

payever-assessment's Introduction

Description

Test project with NestJS, MongoDB, and RabbitMQ. Contains thorough end-to-end, integration, and unit tests on Jest test suite.

Prerequisites

Service requires MongoDB and RabbitMQ to operate. You have to either provide these services, or use the command below to build a containerized version of them in your local machine:

docker compose up

Then provide the following environment variables for the service. You can store them in a .env-style file.

Variable Description Default
APP_PORT The port application listens to. 3000
MAIL_SMTP_SERVER_DOMAIN SMTP server domain name to connect. gmail.com
MAIL_SMTP_SERVER_PORT SMTP server port to connect. 25
MAIL_SERVICE_ADDRESS Service's email address. [email protected]
MAIL_ADMIN_ADDRESS Service admin's email address. [email protected]
MONGO_ROOT_USERNAME MongoDB root username. root
MONGO_ROOT_PASSWORD MongoDB root password.
MONGO_HOST MongoDB host. localhost
MONGO_PORT MongoDB port. 27017
MONGO_DATABASE Service's database name. payever
RMQ_HOST RabbitMQ host. localhost
RMQ_PORT RabbitMQ port. 5672
FILE_SYSTEM_AVATAR_STORAGE_PATH Directory name in file systemto store fetched avatars. avatar
REQRES_BASE_URL Base URL for reqres website https://reqres.in
MOCKSERVER_PORT Mockserver port (only used in integration tests). 10001

Install Dependencies

To install required packages:

npm install

Run

To start the service:

npm run start

Test

Code includes three test packages

End-to-End Test

Provide test/e2e/.env.e2e file with environment variables that the service is going to use in end-to-end tests. Then run the following:

npm run test:e2e

Integration Test

Provide test/e2e/.env.integration file with environment variables that the service is going to use in integration tests. Note that in integration tests, not all of modules and APIs are going to be used simultaneously, so each integration test suite only uses the environment variables that are relevent to it. Run the following command to run integration tests:

npm run test:inte

Unit Test

To run unit tests, use the command below:

npm run test:unit

payever-assessment's People

Contributors

omidazadi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.