Git Product home page Git Product logo

contatos-api's People

Contributors

sergiomoura avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

killiandb

contatos-api's Issues

Escrever testes para rotas

Feito? Método URI
💚 POST /api/v1/auth/register
💚 POST /api/v1/auth/login
💔 PUT /api/v1/profile
💔 GET /api/v1/contacts
💔 POST /api/v1/contacts
💔 DELETE /api/v1/contacts/:contactId
💔 POST /api/v1/contacts/:contactId/emails
💔 DELETE /api/v1/contacts/:contactId/emails/:emailId
💔 POST /api/v1/contacts/:contactId/phones
💔 DELETE /api/v1/contacts/:contactId/phones/:phoneId

Escrever testes para utils

  • Crypter
  • HashGenerator
  • JsonValidator
  • Tokenizer
  • Validators

Rodando os testes

Para rodar os testes execute:

yarn test

Escrever testes para usecases

Restam alguns usecases sem testes

  • AddContactUseCase.spec.ts
  • AddEmailUseCase.spec.ts
  • AddPhoneNumberUseCase.spec.ts
  • CreateUserUseCase.spec.ts
  • DeleteContactUseCase.spec.ts
  • DeleteEmailUseCase.ts
  • DeletePhoneNumberUseCase.spec.ts
  • GetUserByEmailUseCase.spec.ts
  • ListContactsUseCase.spec.ts
  • UpdateUserUseCase.spec.ts
  • VerifyUserUseCase.spec.ts

Rodando os testes

Para rodar os testes execute:

yarn test

Refatorar testes existentes para nova estrutura de pastas

Descrição do Problema

Depois da reestruturação das pastas alguns testes pararam de funcionar.

Etapas para reproduzir o problema

Execute

yarn test

O vitest deverá abrir uma aba em seu navegador exibindo os resultados dos testes.

Comportamento esperado

Que todos os testes atualmente já escritos, passem

Capturas de tela

image

Solução proposta (se aplicável)

Refatorar a pasta de testes

Escrever testes para middlewares

  • CheckRequestAuthentication.mw.spec.ts
  • ValidateContactCreationData.mw.spec.ts
  • ValidateEmailCreationData.mw.spec.ts
  • ValidatePhoneNumberCreationData.mw.spec.ts
  • ValidateUserCreationData.mw.spec.ts
  • ValidateUserUpdateData.mw.spec.ts

Rodando os testes

Para rodar os testes execute:

yarn test

Escrever testes para mappers

Descrição

Os mapeadores são funções que geram DTO (Data Transfer Objects) a partir das entidades. Eles existem para que, junto com DTOs, seja simples e replicável a estruturação de informações que são enviadas para os clientes.
Atualmente, todos os Mappers estão como métodos da classe Mappers.

  • mappers.getEmailOutDto.spec.ts
  • mappers.getPhoneNumberOutDto.spec.ts
  • mappers.getContactOutDto.spec.ts
  • mappers.getUserOutDto.spec.ts

Rodando os testes

Para rodar os testes execute:

yarn test

Escrever testes para controllers

  • AddContactController.spec.ts
  • AddEmailController.spec.ts
  • AddPhoneNumberController.spec.ts
  • CreateUserController.spec.ts
  • DeleteContactController.spec.ts
  • DeleteEmailController.spec.ts
  • DeletePhoneNumberController.spec.ts
  • GetOpenApiSpecController.spec.ts
  • ListContactsController.spec.ts
  • LoginController.spec.ts
  • UpdateUserController.spec.ts

Rodando os testes

Para rodar os testes execute:

yarn test

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.