Skip to content

A simple calculator developed during an internship at Foothill, designed to practice unit testing.

Notifications You must be signed in to change notification settings

Jamal-SaadEddin/calc-app-unit-testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaScript Calculator

Overview

This project is part of an internship assignment at Foothill, focused on developing a JavaScript calculator with an emphasis on writing comprehensive unit tests. The calculator supports basic arithmetic operations such as addition, subtraction, multiplication, and division, and includes robust input validation.

Features

  • Performs addition, subtraction, multiplication, and division.
  • Validates input types and operators to ensure correct calculations.
  • Handles edge cases like division by zero and numbers greater than 1000, which are ignored.
  • Developed with test-driven development techniques to ensure functionality and reliability.

Usage

To use the calculator, require the module in your JavaScript code and pass parameters as follows:

{
  num1: <number>,
  operation1: <string>,
  num2: <number>,
  operation2: <string, optional>,
  num3: <number, optional>
}

The calculator executes the operations in sequence and returns the computed result.

Installation

Clone this repository to your local machine to get started. Ensure you have Node.js installed to run the calculator.

Testing

The project includes a calculator.test.js file, which demonstrates how to write unit tests for each function and scenario. It is a vital part of the internship's focus on learning test-driven development and achieving high code quality.

Authors

Acknowledgements

  • This task is part of the Foothill Technology Solutions Internship Cycle.
  • Big thanks to my trainer @Huthaifa
foothill logo

Thank you for visiting my project! Feel free to star or contribute to the repository if you find it useful.

About

A simple calculator developed during an internship at Foothill, designed to practice unit testing.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published