Skip to content

jaamaalxyz/unit-test-in-js

Repository files navigation

CLI Based Calculator

A simple CLI based calculator with unit test

Getting Started

Clone this project

  git clone https://github.com/jamal-pb95/unit-test-in-js.git

Prerequisites

Your computer should have Node with npm. otherwise at first install Node with npm from here.

Installing

  npm install

then open CLI or Terminal then type:

  node calc

Running the tests

we have a test script. so if you want to know about test cases and try to show the output. please run below command:

  npm test

after successful compilation, you will show below result:

    √ should calculates the sum of 1 and 3
    √ should return -2 to for added -1 and -1
    √ should return 30 when subtract from 33 to 3
    √ should return 20 when 5 multiplied by 4
    √ should return 2 when 10 divide by 5
    √ indicates failure when a string is used instead of a number
    √ indicates failure when two strings is used instead of numbers
    √ successfully run when two inputs are number

    8 passing

Built With

Blog Posts

I have written two parts blog post by building this project step by step.

  1. জাভাস্ক্রিপ্ট ইউনিট টেস্টিং ও একটি CLI ক্যালকুলেটর App এর গল্প।পর্ব - ১
  2. জাভাস্ক্রিপ্ট ইউনিট টেস্টিং ও একটি CLI ক্যালকুলেটর App এর গল্প।পর্ব - 2

Contributing

Please read CONTRIBUTING.md for details and the process for submitting pull requests.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

A simple CLI based calculator with Unit test

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published