Giter Site home page Giter Site logo

calculadora_ejercicio's Introduction

JS - 10 Unit Tests in JavaScript



Part 1: Verify and Run Tests

  1. Download the file and navigate using the terminal inside the js folder.
  2. Run the following command to install the dependencies using NPM:
  npm install
  1. Run the unit tests and verify the results:
  npm test
  1. Open the js folder on Visual Studio Code and verify the existing test.

Part 2: Implement Calculator test

  1. Implement 2 unit tests for the divide function.
  2. Implement 2 unit tests for the multiply function.

Part 3: Implement UserController test

  1. Implement 1 test for the add function that verifies a user that is not in the users' list.
  2. Implement 1 test for the remove function that verifies a user that is not in the users' list.
  3. Implement 2 unit tests for the findByEmail function.
  4. Implement 2 unit tests for the findById function.

Challenge Yourself

In Test Driven Development you write the first test that fails, and then you add the code so test can pass.

  1. Write a unit test to verify the function divide by passing 0 as the second argument.
  2. Fix the divide function so the test passes and it does handle the case for division by 0.

calculadora_ejercicio's People

Contributors

rulmaker 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.