This project is part of The Odin Project focuses on practicing testing using Jest.
-
Capitalize Function
- A function that takes a string and returns it with the first character capitalized.
-
Reverse String Function
- A function that takes a string and returns it reversed.
-
Calculator Object
- An object that contains functions for the basic operations: add, subtract, divide, and multiply. Each of these functions should take two numbers and return the correct calculation.
-
Caesar Cipher Function
- A function that takes a string and a shift factor and returns it with each character “shifted”.
- Wraps from z to a. For example,
caesarCipher('xyz', 3)
should return'abc'
. - Preserves case. The shifted lettercase should follow the original lettercase. For example,
caesarCipher('HeLLo', 3)
should return'KhOOr'
. - Keeps punctuation unchanged. For example,
caesarCipher('Hello, World!', 3)
should return'Khoor, Zruog!'
.
-
Analyze Array Function
- A function that takes an array of numbers and returns an object with the following properties: average, min, max, and length.
const object = analyzeArray([1, 8, 3, 4, 2, 6]); object == { average: 4, min: 1, max: 8, length: 6 };
- JavaScript (ES6)
- Jest
-
Clone the Repository:
git clone git@github.com:ExtF8/testingBasics.git cd testingBasics
-
Install Dependencies:
npm install
-
Run Tests:
- To run the tests:
npm test
- To run the tests in watch mode:
npm run watch