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

https://github.com/amitjimiwal/calculator-tsproject

A simple arithmetic Calculator built with ReactJS ,TypeScript
https://github.com/amitjimiwal/calculator-tsproject

calculator opensource reactjs typescript webdevelopment

Last synced: about 2 months ago
JSON representation

A simple arithmetic Calculator built with ReactJS ,TypeScript

Awesome Lists containing this project

README

        

# Calculator TypeScript Project

![Calculator App Screenshot](https://res.cloudinary.com/dejzy9q65/image/upload/v1691147330/Screenshot_from_2023-08-04_16-37-22_xoqtf6.png)

## Description

This is a simple calculator application implemented in TypeScript. It allows users to perform basic arithmetic calculations such as addition, subtraction, multiplication, and division.

## Features

- Addition: Add two or more numbers together.
- Subtraction: Subtract one number from another.
- Multiplication: Multiply two or more numbers.
- Division: Divide one number by another.
- Error Handling: The app provides meaningful error messages for invalid inputs and division by zero.

## Getting Started

### Prerequisites

To run this application, you need to have Node.js and npm (Node Package Manager) installed on your system.

### Installation

1. Clone the repository to your local machine using the following command:

```
git clone https://github.com/amitjimiwal/calculator-tsproject.git
```

2. Change into the project directory:

```
cd calculator-tsproject
```

3. Install the required dependencies:

```
npm install
```

### Usage

1. Once the installation is complete, you can start the application using:

```
npm run dev
```

2. Open your web browser and navigate to http://localhost:5173 to access the calculator app.

3. Enter the numbers and perform the desired calculations.

### Contributing

Contributions to this project are welcome. If you find any bugs or have suggestions for improvements, feel free to open an issue or create a pull request.

1. Fork the repository from the GitHub page: [https://github.com/amitjimiwal/tsprojecttodo](https://github.com/amitjimiwal/tsprojecttodo)

2. Clone your forked repository to your local machine.

3. Create a new branch for your feature or bug fix:

```bash
git checkout -b feature/your-feature-name
```

4. Make your changes and commit them with descriptive commit messages:

```bash
git commit -m "Add new feature" -m "Description of the changes."
```

5. Push the changes to your forked repository:

```bash
git push origin feature/your-feature-name
```

6. Create a pull request on the original repository, explaining the changes you made and their benefits.

We appreciate your contributions, and together, we can make this Project even better!

## Test Cases

The calculator-tsproject comes with a comprehensive set of test cases to ensure the correctness and reliability of the application. The test cases are implemented using [Jest](https://jestjs.io/), a popular JavaScript testing framework.

To run the tests locally, make sure you have completed the installation steps mentioned in the **Getting Started** section.

### Running Tests

1. Navigate to the root of the project where the `package.json` file is located.

2. Run the following command to execute the tests:

```bash
npm test
```

Jest will then run the test suite and display the results in your terminal.

### Writing Tests

If you want to contribute to this project or add more test cases, you can find the test files in the `__tests__` folder located at the root of the project.

The test files are organized in a way that each functionality of the calculator has its own separate test file. For example:

- `yourfucntion.test.ts`: Contains test cases for the your functionality.

Feel free to add more test cases to ensure full test coverage and verify the edge cases.

### LICENSE

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Authors

- Amit Jimiwal - [GitHub](https://github.com/amitjimiwal)