Code & personal notes of the book Test Driven JavaScript Development by Christian Johansen.
- Chapter 01. Automated Testing
- Chapter 02. The TDD Process
- Chapter 03. Tools of the Trade
- Chapter 04. Test to Learn
- Chapter 05. Functions
- Chapter 06. Applied Functions and Closures
- Chapter 07. Objects and Prototypal Inheritance
- Chapter 08. ECMAScript 5th Edition
- Chapter 09. Unobtrusive JavaScript
- Chapter 10. Feature Detection
- Chapter 11. The Observer Pattern
- Chapter 12. Abstracting Browser Differences: Ajax
- Chapter 13. Streaming Data with Ajax and Comet
- Chapter 14. Server-Side JavaScript with Node.js
- Chapter 15. TDD and DOM Manipulation: The Chat Client
- Chapter 16. Mocking and Stubbing
- Chapter 17. Writing Good Unit Tests
Install Mocha.js globally
npm install --global mocha
Only for chapters 1 and 2. Ignores the usage of
mocha
command
npm run test:spec
npm run test
Loops (Chapter 04):
npm run bench:loops
Fibonacci (Chapter 06):
npm run bench:fibonacci
Loops with timeout (Chapter 06):
node ./06-applied-functions-and-closures/benchmarks/loops-timeout.js