GithubHelp home page GithubHelp logo

imperial-metric-converter's Introduction

FreeCodeCamp- Information Security and Quality Assurance

My preview The project can be found at: https://imperialmetricconverter.glitch.me

  • Complete the necessary conversion logic in /controllers/convertHandler.js

  • Complete the necessary routes in /routes/api.js

  • Copy the sample.env file to .env and set the variables appropriately

  • To run the tests uncomment NODE_ENV=test in your .env file

  • To run the tests in the console, use the command npm run test. To open the Repl.it console, press Ctrl+Shift+P (Cmd if on a Mac) and type "open shell"

  • Postman test cases can be found in /tests/GET suite.postman_collection.json

  • Postman test results can be found in /tests/GET suite.postman_test_run.json

  • A very basic manual test case template can be found in /tests/IMC_TestCase.ods Write the following tests in tests/1_unit-tests.js:

  • convertHandler should correctly read a whole number input.

  • convertHandler should correctly read a decimal number input.

  • convertHandler should correctly read a fractional input.

  • convertHandler should correctly read a fractional input with a decimal.

  • convertHandler should correctly return an error on a double-fraction (i.e. 3/2/3).

  • convertHandler should correctly default to a numerical input of 1 when no numerical input is provided.

  • convertHandler should correctly read each valid input unit.

  • convertHandler should correctly return an error for an invalid input unit.

  • convertHandler should return the correct return unit for each valid input unit.

  • convertHandler should correctly return the spelled-out string unit for each valid input unit.

  • convertHandler should correctly convert gal to L.

  • convertHandler should correctly convert L to gal.

  • convertHandler should correctly convert mi to km.

  • convertHandler should correctly convert km to mi.

  • convertHandler should correctly convert lbs to kg.

  • convertHandler should correctly convert kg to lbs.

Write the following tests in tests/2_functional-tests.js:

  • Convert a valid input such as 10L: GET request to /api/convert.
  • Convert an invalid input such as 32g: GET request to /api/convert.
  • Convert an invalid number such as 3/7.2/4kg: GET request to /api/convert.
  • Convert an invalid number AND unit such as 3/7.2/4kilomegagram: GET request to /api/convert.
  • Convert with no number such as kg: GET request to /api/convert.

imperial-metric-converter's People

Contributors

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