Skip to content

Latest commit

 

History

History
10 lines (6 loc) · 1.15 KB

README.md

File metadata and controls

10 lines (6 loc) · 1.15 KB

testing-exercise

This is a repository containing a set of unit tests for four basic JavaScript functions: calculator, capitalize, reverseString, and stringLength. These tests were developed using the Jest testing framework.

The calculator function performs basic arithmetic operations (addition, subtraction, multiplication, and division) on two numbers. The capitalize function takes a string and capitalizes its first letter. The reverseString function takes a string and reverses its characters. The stringLength function takes a string and returns its length.

Each function has its own test file, located in the tests directory. These files contain a series of test cases designed to ensure that the function behaves correctly under a variety of conditions. The tests cover typical use cases as well as edge cases and error conditions.

To run the tests, clone the repository and run npm install to install the necessary dependencies. Then, run npm test to execute the tests using Jest.

This repository can be used as a reference for writing unit tests for other JavaScript functions or as a starting point for building a larger test suite for a more complex application.