Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/lauraatenciob/tdd-practice

Basic calculator with TDD
https://github.com/lauraatenciob/tdd-practice

reactjs tdd vitest

Last synced: about 1 month ago
JSON representation

Basic calculator with TDD

Awesome Lists containing this project

README

        

# Calculator App - TDD Learning Project

This is a project built to practice and demonstrate **Test-Driven Development (TDD)** and automated testing techniques using modern tools like **Vitest**, **React.js**, and **React Testing Library**.

## Project Purpose

The goal of this project is to learn and improve skills in:

- **Test-Driven Development (TDD):** Writing tests before implementing functionality.
- **Automated Testing:** Using tools like Vitest and React Testing Library to ensure code correctness.
- **React Development:** Building a simple, functional calculator using React.js.

## Tech Stack

- **React.js:** A JavaScript library for building user interfaces.
- **Vitest:** A fast, lightweight testing framework for JavaScript, perfect for TDD.
- **React Testing Library:** A set of utilities to test React components by simulating user interactions.

## Development

Follow these steps to get the project up and running on your local machine:

### Prerequisites

You need to have **Node.js** and **npm** installed. If you don't have them, you can download from [Node.js official website](https://nodejs.org/).

### Installation

1. Clone the repository:

```bash
git clone https://github.com/your-username/calculator-tdd.git
cd calculator-tdd
```

2. Install the dependencies:

```bash
npm install
```

### Avaliable Scripts

To start the application in development mode, run:

```bash
npm run dev
```
To execute the test suite and see the results, run:

```bash
npm test
```

## Learning Outcomes

- Understand the fundamentals of TDD and how to apply it in real-world projects.
- Gain experience in writing unit tests and integration tests for React applications.
- Learn how to use Vitest for efficient test execution.
- Understand how to simulate user interactions with React Testing Library.

## Contributions

Since this project is intended for learning, feel free to fork the repository and experiment with it. If you'd like to contribute, you can create a pull request with your improvements or new features.

## License

This project is open-source and available under the MIT License.