Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kbelltree/testing-practice
Project: Testing Practice
https://github.com/kbelltree/testing-practice
caesar-cipher javascript jest-tests js odin-project
Last synced: about 22 hours ago
JSON representation
Project: Testing Practice
- Host: GitHub
- URL: https://github.com/kbelltree/testing-practice
- Owner: kbelltree
- Created: 2024-08-13T21:45:55.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-08-16T22:23:10.000Z (6 months ago)
- Last Synced: 2024-08-16T23:32:24.101Z (6 months ago)
- Topics: caesar-cipher, javascript, jest-tests, js, odin-project
- Language: JavaScript
- Homepage: https://github.com/kbelltree/testing-practice/blob/main/index.js
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# testing-practice
## Project: Testing Practice
This project is a practice exercise for Test Driven Development (TDD) using **Jest** in JavaScript. For comprehensive details on this project, please refer to [The Odin Project - Project: Testing Practice](https://www.theodinproject.com/lessons/node-path-javascript-testing-practice).
## Key Project Instructions:
Write tests for the following functions and ensure that all tests pass.
### Functions To Test
- `capitalize`:
Capitalizes the first letter of a string.
- `reverseString`:
Reverses the order of a string.
- `calculator` **object** containing the following methods:
- `add`
- `subtract`
- `divide`
- `multiply`
- `caesarCipher`:
Takes a string and a shift factor, returning an encrypted ("shifted") version of the string.
**Requirements:**1. The alphabet should wrap around according to the shift factor, e.g., **caesarCipher('xyz', 3)** should return **'abc'**.
2. The case of each letter should remain the same as in the original string, e.g., **caesarCipher('HeLLo', 3)** should return **'KhOOr'**.
3. Punctuation and other special characters should remain unchanged, e.g., **caesarCipher('Hello, World!', 3)** should return **'Khoor, Zruog!'**.- `analyzeArray`:
TTakes an array of numbers as a parameter and returns an object containing the `average`, `min`, `max`, `length` of the array.**[Link to My Functions](./index.js)**
**[Link to My Tests](./index.test.js)**## Built With
- JavaScript
- Prettier
- Jest---
### Referenced Tutorials
[Test-Driven Development Tutorial – How to Test Your JavaScript and ReactJS Applications by freeCodeCamp](https://www.freecodecamp.org/news/test-driven-development-tutorial-how-to-test-javascript-and-reactjs-app/#heading-javascript-example-of-a-test-driven-development-workflow)
[3 The Caesar Cipher and Modular Arithmetic by Scott Sutherland](https://www.math.stonybrook.edu/~scott/papers/MSTP/crypto/3Caesar_Cipher.html)
[How to get min or max of an array in JavaScript by Vlad Bezden](https://medium.com/@vladbezden/how-to-get-min-or-max-of-an-array-in-javascript-1c264ec6e1aa)
[How to Check if a String is Empty or Null in JavaScript – JS Tutorial by freeCodeCamp](https://www.w3schools.com/jsref/jsref_some.asp)