This document provides an overview of test-driven development (TDD) practices and tools for JavaScript developers. It discusses what TDD is, how to get started with TDD, and popular JavaScript testing frameworks like Mocha and Chai. It also covers tools for tasks, package management, continuous integration, code analysis, stubs, spies, and documentation for TDD in JavaScript.
4. What about TDD?
●
●
●
●
●
●
●
Unit tests coverage
Increases assurance of correctness
More complete explorations of requirements
Improved code
Code as documentation
Safe refactoring
No extra code
30. Mocha - setUp and tearDown
beforeEach(function() {
//code here call every time at start of test
});
afterEach(function() {
//code here call every time at after test
});