- Learning Behavior:driven Development with JavaScript
- Enrique Amodeo
- 117字
- 2021-07-23 20:52:34
Chapter 2. Automating Tests with Mocha, Chai, and Sinon
Before we start making some BDD, let's familiarize ourselves with the basic tools available in JavaScript to write and execute a test. In this chapter, we will explore the main capabilities of Mocha, the most popular test runner in JavaScript. We will perform the following tasks:
- Writing expressive assertions using the Chai package
- Creating test doubles using the Sinon and sinon-chai packages
- Exploring the basic techniques for organizing our test codebase
To achieve these goals, we will perform a small code kata, or coding exercise, where we will be able to practice not only the tools, but also the test-first cycle explained in the previous chapter.
推薦閱讀
- Learn Blockchain Programming with JavaScript
- Java Web程序設計
- Microsoft System Center Orchestrator 2012 R2 Essentials
- 名師講壇:Spring實戰開發(Redis+SpringDataJPA+SpringMVC+SpringSecurity)
- Python編程實戰
- 青少年信息學競賽
- RESTful Java Web Services(Second Edition)
- Programming with CodeIgniterMVC
- 鴻蒙OS應用編程實戰
- Hands-On Neural Network Programming with C#
- 玩轉.NET Micro Framework移植:基于STM32F10x處理器
- Web開發的平民英雄:PHP+MySQL
- HTML5 WebSocket權威指南
- HTML5/CSS3/JavaScript技術大全
- SOA Patterns with BizTalk Server 2013 and Microsoft Azure(Second Edition)