Giter Club home page Giter Club logo

maximilianoalves / supertest-arch-example Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 0.0 893 KB

pt_BR: Este projeto tem por objetivo apresentar uma arquitetura de testes de API utilizando SuperTest. // en_US: This project has with main objective show a simple architecture for api tests using SuperTest framework.

Home Page: http://maximilianoalves.github.io/supertest-arch-example

JavaScript 100.00%
supertest-mocha-chai supertest javascript chai

supertest-arch-example's Introduction

Architecture example using SuperTest for api tests

CI para executar o teste e salvar o report no gh-pages.

Para acessar a versΓ£o em PortuguΓͺs do Brasil, basta clicar aqui! πŸ‡§πŸ‡·

This project has with main objective show a simple architecture for api tests using SuperTest framework.

Technologies and tools used:

File Structure

πŸ“¦ supertest-arch-example
┣ πŸ“‚ .github
┃ β”— πŸ“‚ workflows
┃ ┃ β”— πŸ“œ deploy.yml
┣ πŸ“‚ env
┃ β”— πŸ“œ production.env.json
┣ πŸ“‚ report
┃ ┣ πŸ“‚ assets
┃ β”— πŸ“œ index.html
┣ πŸ“‚ test
┃ ┣ πŸ“‚ login
┃ ┃ ┣ πŸ“‚ payloads
┃ ┃ ┃ β”— πŸ“œ login.payload.js
┃ ┃ ┣ πŸ“‚ requests
┃ ┃ ┃ β”— πŸ“œ login.request.js
┃ ┃ β”— πŸ“‚ tests
┃ ┃ ┃ ┣ πŸ“œ login.post.test.js
┃ ┣ πŸ“‚ produtos
┃ β”— πŸ“‚ usuarios
┃ ┃ ┣ πŸ“‚ schemas
┃ ┃ ┃ ┣ πŸ“œ usuario.schema.js
┃ ┃ ┃ β”— πŸ“œ usuarios.schema.js
┃ ┃ ┣ πŸ“‚ payloads
┃ ┃ ┃ β”— πŸ“œ usuario.payload.js
┃ ┃ ┣ πŸ“‚ requests
┃ ┃ ┃ β”— πŸ“œ usuarios.request.js
┃ ┃ β”— πŸ“‚ tests
┃ ┃ ┃ ┣ πŸ“œ usuarios.delete.test.js
┃ ┃ ┃ ┣ πŸ“œ usuarios.get.test.js
┃ ┃ ┃ β”— πŸ“œ usuarios.post.test.js
┣ πŸ“‚ utils
┃ β”— πŸ“œ global.js
┣ πŸ“œ .gitignore
┣ πŸ“œ .mocharc.js
┣ πŸ“œ README.md
┣ πŸ“œ package-lock.json
β”— πŸ“œ package.json

Execution Examples

  • By npm:

    • To run all tests suite:
      • npm run test:prod
    • Only json schema tests suite:
      • npm run test:prod:schema
  • By the command line:

    • To run all tests suite:
      • NODE_ENV=production mocha
    • Only json schema tests suite:
      • NODE_ENV=production mocha --grep=schema

Execution report

Using the mochawesome and git workflows:

Doubts or improvements !? contact me:

Twitter Medium Linkedin Instagram Facebook

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.