https://github.com/lucasgianine/jest-software-unit-testing
🃏 Using the JestJS library created by Facebook to create unit tests/automated tests for software.
https://github.com/lucasgianine/jest-software-unit-testing
automated-testing unit-testing
Last synced: over 1 year ago
JSON representation
🃏 Using the JestJS library created by Facebook to create unit tests/automated tests for software.
- Host: GitHub
- URL: https://github.com/lucasgianine/jest-software-unit-testing
- Owner: lucasgianine
- Created: 2024-02-19T00:03:01.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-19T00:34:24.000Z (over 2 years ago)
- Last Synced: 2025-01-31T12:16:42.412Z (over 1 year ago)
- Topics: automated-testing, unit-testing
- Language: JavaScript
- Homepage: https://jestjs.io/
- Size: 37.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Unit and Automated Testing | JEST Library 🃏
## What are Unit Testing/Automated Testing?
Unit tests are procedures used in software engineering to validate the smallest testable part of an application, such as functions or methods. The goal is to ensure that each unit performs as expected. Automated tests are those performed by a machine, validating if different parts of the software are working correctly without manual intervention.
## When to Use Unit Tests
Unit tests are essential:
- **During Development:** To ensure new functionalities do not break existing features.
- **Before Refactoring:** To ensure changes in code do not alter the expected behavior.
- **For Documentation:** They serve as examples of how to use the tested units.
## Quick Guide on How to Perform Unit Testing Using JEST and JavaScript
#### 1. Environment Setup
Install JEST as a development dependency:
```bash
npm install --save-dev jest
```
In your `package.json`, add or modify the test script to use Jest:
```json
"scripts": {
"test": "jest --coverage"
}
```
#### 2. Running the Tests
Execute the following command in the terminal:
```bash
npm test
```
Jest will automatically find test files and execute them. If everything is correct, you will see an output indicating that the test passed.
## Result

## About repo

*(README criado com ajuda de IA)*