Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jamal-saadeddin/calc-app-unit-testing

A simple calculator developed during an internship at Foothill, designed to practice unit testing.
https://github.com/jamal-saadeddin/calc-app-unit-testing

aaa-testing test-driven-development unit-testing

Last synced: about 24 hours ago
JSON representation

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

Awesome Lists containing this project

README

        

# 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:
```javascript
{
num1: ,
operation1: ,
num2: ,
operation2: ,
num3:
}
```
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
- [Jamal SaadEddin](github.com/Jamal-SaadEddin)

## Acknowledgements
- This task is part of the Foothill Technology Solutions Internship Cycle.
- Big thanks to my trainer [@Huthaifa](https://github.com/Huthaifa-Dev)
foothill logo

---

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