Practicing unit testing using Jest. Tests for the following functions:
A capitalize
function that takes a string and returns it with the first character capitalized.
A reverseString
function that takes a string and returns it reversed.
A calculator
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.
A caesarCipher
function that takes a string and returns it with each character “shifted”.
An analyzeArray
function that takes an array of numbers and returns an object with the following properties: average
, min
, max
, and length
.