官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 信阳市| 九龙城区| 多伦县| 呼图壁县| 长汀县| 临夏县| 景东| 焦作市| 海丰县| 宕昌县| 嘉义县| 宝鸡市| 达孜县| 南城县| 富锦市| 塔城市| 长治县| 长乐市| 吕梁市| 曲靖市| 博罗县| 台中市| 嵊泗县| 保山市| 中超| 柯坪县| 泰兴市| 永春县| 辰溪县| 兴安盟| 洛浦县| 九龙县| 津市市| 柘荣县| 荔浦县| 四川省| 内黄县| 阿拉善右旗| 集安市| 卓尼县| 西吉县|