Skip to content

prtpj1/project-js-unit-tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

6º Projeto: Unit Tests em JavaScript

Header


Project DescriptionLearningRequirementsStacksHow to run the application


Descrição do ProjetoAprendizadoRequisitosTecnologias UtilizadasRodar a Aplicação


Project Description

In this project, I wrote unit tests for functions using the Jest module in NodeJS to verify the correct functioning of functions provided by Trybe. Additionally, I wrote functions so that they would pass the tests provided by Trybe.
Both the tests and functions were written following a test-driven development (TDD) approach.

In this project, I learned and put into practice

  • Writing unit tests for functions using the Jest module in NodeJS to verify their correct behavior
  • Writing functions based on pre-implemented tests to meet the proposed test cases
  • Using a test-driven development (TDD) approach to write both tests and functions

According to the project requirements designated by Trybe, I learned how to

  • ✅ Implement the average function
  • ✅ Implement the test cases for the numbers function
  • ✅ Implement the vqv function
  • ✅ Implement the test cases for the circle function
  • ✅ Implement the createStudent function
  • ✅ Implement the calculator and arrayGenerator functions
  • ✅ Implement the myCounter function
  • ✅ Implement the test cases for the getCharacter function
  • ❌ Implement the test cases for the productDetails function
  • ❌ Implement the test cases and the createMenu function

Note: In some projects, certain requirements were not completed due to the accelerated pace of the course, not because I couldn't do them. At the time, I just needed a little more time.

I haven't decided yet if it's better to keep it this way to show my learning progress or if I should complete the missing requirements from the course projects.

Feedback is welcome.

Stacks

FrontEnd

  • JavaScript
  • Jest
  • Node

JavaScript IconJest IconNodeJS Icon

How to run the application?

  • Clone the repository:
    git clone git@github.com:prtpj1/project-js-unit-tests.git
  • Access the project folder:
    cd project-js-unit-tests
  • Install the dependencies:
    npm install
  • Run the tests separately:
    npm test tests/numbers.spec.js
    npm test tests/circle.spec.js
    npm test tests/productDetails.spec.js
    npm test tests/getCharacter.spec.js
    npm test tests/createMenu.spec.js
  • Or run all tests at once:
    npm test

⚠️Important

The productDetails and createMenu tests were not written during the course, so they will fail. I plan to complete them in the future.


Note:
At the time I created this project, I wasn't familiar with Conventional Commits. I only learned and started making better commits from the BackEnd module of the Trybe course onward.

If you have any difficulty with the instructions and want to give feedback, feel free to send me a message


Descrição do Projeto

Neste projeto, escrevi testes unitários para funções utilizando o módulo Jest do NodeJS para verificar o correto funcionamento de funções forncidas pela Trybe e também escrevi funções para que funcionassem corretamente de acordo com testes fornecidos também pela Trybe.
Os testes e funções foram escritos utilizando uma abordagem de desenvolvimento orientado a testes.

Nesse projeto, aprendi e coloquei em prática

  • Escrever testes unitários para funções utilizando o módulo Jest do NodeJS para verificar o correto funcionamento dessas funções
  • A partir de testes já implementados, escrever funções de forma que elas atendam aos testes propostos
  • Escrever testes e funções utilizando uma abordagem de desenvolvimento orientado a testes

De acordo com os requisitos do projeto designados pela Trybe aprendi como

  • ✅ Implementar a função average
  • ✅ Implementar os casos de teste para a função numbers
  • ✅ Implementar a função vqv
  • ✅ Implementar os casos de teste para a função circle
  • ✅ Implementar a função createStudent
  • ✅ Implementar as funções calculator e arrayGenerator
  • ✅ Implementar a função myCounter
  • ✅ Implementar os casos de teste da função getCharacter
  • ❌ Implementar os casos de teste para a função productDetails
  • ❌ Implementar os casos de teste e a função createMenu

OBS: Em alguns projetos alguns requisitos não foram feitos devido a dinamica acelerada do curso e não por eu não saber como fazê-los. Na época eu apenas precisaria de um pouco mais de tempo.

Ainda não decidi se é melhor deixar desta forma para demonstrar o meu progresso durante meu aprendizado ou se seria melhor completar os requisitos que ficaram faltando nos projetos do curso.

Feedbacks são bem vindos.

Tecnologias Utilizadas

FrontEnd

  • JavaScript
  • Jest
  • Node

JavaScript IconJest IconNodeJS Icon

Como rodar a aplicação?

  • Clone o repositório:
    git clone git@github.com:prtpj1/project-js-unit-tests.git
  • Acesse a pasta do projeto:
    cd project-js-unit-tests
  • Instale as dependências:
    npm install
  • Rode os testes separadamente:
    npm test tests/numbers.spec.js
    npm test tests/circle.spec.js
    npm test tests/productDetails.spec.js
    npm test tests/getCharacter.spec.js
    npm test tests/createMenu.spec.js
  • Ou rode todos os testes de uma vez:
    npm test

⚠️Importante

Os testes productDetails e createMenu não foram escritos durante o curso, por tanto falharão. Pretendo completa-los no futuro.


OBS:
Na época que fiz este projeto eu ainda não conhecia os Conventional Commits. Somente a partir do módulo de BackEnd do curso da Trybe que aprendi e comecei a fazer commits melhores.

Se tiver alguma dificuldade com as instruções e quiser dar um feedback me mande uma mensagem

About

Os testes e funções escritos utilizando uma abordagem de desenvolvimento orientado a testes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors