https://github.com/odilson-dev/testing-practice
Practicing TDD(Test Driven Development) from Odin
https://github.com/odilson-dev/testing-practice
html-css-javascript jest-tests npm tdd-javascript test theodinproject
Last synced: 11 months ago
JSON representation
Practicing TDD(Test Driven Development) from Odin
- Host: GitHub
- URL: https://github.com/odilson-dev/testing-practice
- Owner: odilson-dev
- Created: 2024-03-23T22:44:55.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-25T23:06:06.000Z (almost 2 years ago)
- Last Synced: 2025-02-23T20:52:44.906Z (11 months ago)
- Topics: html-css-javascript, jest-tests, npm, tdd-javascript, test, theodinproject
- Language: HTML
- Homepage: https://www.theodinproject.com/lessons/javascript-testing-practice
- Size: 72.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Testing Practice with Jest
This project aims to practice testing JavaScript functions using Jest. It includes the implementation of several functions along with their respective tests.
## Getting Started
To get started with this project, you'll need Node.js and npm (or yarn) installed on your machine.
1. Clone this repository to your local machine.
2. Install dependencies by running `npm install` or `yarn install`.
3. Run tests using `npm run test` or `yarn run test`.
## Functions Implemented
1. **capitalize**: This function capitalizes the first character of a string.
2. **reverseString**: This function reverses a given string.
3. **calculator**: An object containing functions for basic arithmetic operations (addition, subtraction, division, and multiplication).
4. **caesarCipher**: This function applies the Caesar cipher to a given string based on a shift factor.
5. **analyzeArray**: This function takes an array of numbers and returns an object with properties: average, min, max, and length.
## Testing
Each function has corresponding test suites located in the `__tests__` directory. Tests are written using Jest.
### Running Tests
You can run tests using the command `npm run test` or `yarn run test`. This will execute all test suites and display the results in your console.
## Additional Notes
- Ensure that you have followed the instructions for configuring Jest to handle ES6 import statements if you encounter any issues.
Happy testing!