A simple CLI based calculator with unit test
Clone this project
git clone https://github.com/jamal-pb95/unit-test-in-js.git
Your computer should have Node
with npm
. otherwise at first install Node
with npm
from here.
npm install
then open CLI
or Terminal then type:
node calc
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
- Node
- npm
- JavaScript - JavaScript Programming Language
- Mocha - JavaScript Testing library
I have written two parts blog post by building this project step by step.
- জাভাস্ক্রিপ্ট ইউনিট টেস্টিং ও একটি CLI ক্যালকুলেটর App এর গল্প।পর্ব - ১
- জাভাস্ক্রিপ্ট ইউনিট টেস্টিং ও একটি CLI ক্যালকুলেটর App এর গল্প।পর্ব - 2
Please read CONTRIBUTING.md for details and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE.md file for details