Skip to content

Schveitzer/api-tests-supertest-jest

Repository files navigation

Api tests with Supertest and Jest

In this project I demonstrate how to use Supertest and Jest for Api test automation.

This project includes:

  • Framworks:
    • Supertest
    • Jest
  • Features:
    • Helper´s, Clients´s
    • ES6 style class-based approach
    • Code formatter (ESlint, Prettier)
    • Report with Allure

Requirements

Getting Started

Install dependencies:

$ yarn install

API

For this tests i use a local api which can be found here: Simple jwt local api

To run tests:

$ yarn init:tests

Run Img

Reports

Run the command below to generate the test report:

$ allure generate

To view the report in the browser, run the command:

$ allure serve

Allure report

Lint Code

To lint and format the code, run:

$ yarn code:format

Base url and configurations

The environment variables of other configurations are loaded on EnvironmentVariables.js , to change the base url edit the address in config.json.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published