This project is a testament to my journey of learning Test-Driven Development (TDD) from App Academy Open. It showcases my understanding and application of TDD principles in JavaScript, using popular testing frameworks like Mocha and Chai.
- Introduction
- Technologies
- Setup
- Features
- Status
- Contact
The project was created with:
- JavaScript ES6
- Mocha - version 8.2.1
- Chai - version 4.2.0
To run the tests, navigate to the project directory and run the following command:
mocha test
Key learnings from the project:
- Red-Green-Refactor Cycle: Learned to write failing tests (Red), write minimal code to pass the tests (Green), and then refactor the code for optimization and readability.
- Mocha & Chai: Gained hands-on experience with Mocha as a testing framework and Chai as an assertion library, including Chai’s expect and should styles.
- Chai Spies: Learned to use Chai Spies for tracking function calls, which is crucial for testing callback functions.
- Testing JavaScript Classes: Practiced writing tests for JavaScript classes, including instance methods and static methods.
- Error Handling: Learned to write tests that expect errors to be thrown under certain conditions.