Test-Driving JavaScript Applications: Rapid, Confident, Maintainable Code

0
(0)

Test-Driving JavaScript Applications: Rapid, Confident, Maintainable Code
 

  • Author:Venkat Subramaniam
  • Length: 200 pages
  • Edition: 1
  • Publisher: Pragmatic Bookshelf
  • Publication Date: 2016-10-17
  • ISBN-10: 1680501747
  • ISBN-13: 9781680501742
  • Sales Rank: #1288259 (See Top 100 Books)
  • Download:Register/Login to Download
  • Buy Print:Buy from amazon


    Book Description

    Debunk the myth that JavaScript is not easily testable. Whether you use Node.js, Express, MongoDB, jQuery, AngularJS, or directly manipulate the DOM, you can test-drive JavaScript. Learn the craft of writing meaningful, deterministic automated tests with Karma, Mocha, and Chai. Test asynchronous JavaScript, decouple and properly mock out dependencies, measure code coverage, and create lightweight modular designs of both server-side and client-side code. Your investment in writing tests will pay high dividends as you create code that’s predictable and cost-effective to change.

    Design and code JavaScript applications with automated tests. Writing meaningful tests is a skill that takes learning, some unlearning, and a lot of practice, and with this book, you’ll hone that skill. Fire up the editor and get hands-on through practical exercises for effective automated testing and designing maintainable, modular code.

    Start by learning when and why to do manual testing vs. automated verification. Focus tests on the important things, like the pre-conditions, the invariants, complex logic, and gnarly edge cases. Then begin to design asynchronous functions using automated tests. Carefully decouple and mock out intricate dependencies such as the DOM, geolocation API, file and database access, and Ajax calls to remote servers.

    Step by step, test code that uses Node.js, Express, MongoDB, jQuery, and AngularJS. Know when and how to use tools such as Chai, Istanbul, Karma, Mocha, Protractor, and Sinon. Create tests with minimum effort and run them fast without having to spin up web servers or manually edit HTML pages to run in browsers. Then explore end-to-end testing to ensure all parts are wired and working well together.

    Don’t just imagine creating testable code, write it.

    What You Need:

    A computer with a text editor and your favorite browser. The book provides instructions to install the necessary automated testing-related tools.

    Table of Contents

    Chapter 1. Automation Shall Set You Free

    Part I Creating Automated Tests
    Chapter 2. Test-Drive Your Design
    Chapter 3. Test Asynchrony
    Chapter 4. Tactfully Tackle Dependencies

    Part II Real-World Automated Testing
    Chapter 5. Test-Drive Node.js Apps
    Chapter 6. Test-Drive Express Apps
    Chapter 7. Working with the DOM and jQuery
    Chapter 8. Using AngularJS
    Chapter 9. Test-Drive Angular 2
    Chapter 10. Integrate and Test End-to-End
    Chapter 11. Test-Drive Your Apps

    中文:

    书名:测试驱动JavaScript应用程序:快速、自信、可维护的代码

    揭穿关于JavaScript不容易测试的神话。无论您是使用Node.js、Express、MongoDB、jQuery、AngularJS,还是直接操作DOM,您都可以测试驱动JavaScript。学习如何使用Karma、Mocha和Chai编写有意义的、确定性的自动化测试。测试异步JavaScript,分离并正确模拟依赖关系,测量代码覆盖率,并创建服务器端和客户端代码的轻量级模块化设计。您在编写测试方面的投资将会带来高额回报,因为您创建的代码是可预测的,并且具有更改的成本效益。

    使用自动化测试设计和编码JavaScript应用程序。写有意义的测试是一项需要学习、忘记和大量练习的技能,有了这本书,你将磨练这项技能。启动该编辑器,并通过实践练习进行有效的自动化测试和设计可维护的模块化代码。

    从学习何时以及为什么要进行手动测试和自动验证开始。把重点放在重要的事情上,比如前提条件、不变量、复杂的逻辑和粗糙的边缘情况。然后开始使用自动化测试设计异步函数。仔细地分离和模拟复杂的依赖关系,例如DOM、地理位置API、文件和数据库访问以及对远程服务器的AJAX调用。

    一步一步地测试使用Node.js、Express、MongoDB、jQuery和AngularJS的代码。知道何时以及如何使用诸如柴、伊斯坦布尔、因果报应、摩卡、量角器和辛农等工具。只需最少的工作即可创建测试并快速运行,而无需启动Web服务器或手动编辑要在浏览器中运行的HTML页面。然后探索端到端测试,以确保所有部件都连接在一起并正常工作。

    不要只是想象创建可测试的代码,而要编写它。

    What You Need:

    一台带有文本编辑器和您最喜欢的浏览器的计算机。这本书提供了安装必要的自动化测试相关工具的说明。

    Table of Contents

    第一章:自动化会让你自由

    Part I Creating Automated Tests
    第2章.测试驱动您的设计
    Chapter 3. Test Asynchrony
    第四章.巧妙地解决依赖问题

    第二部分-真实世界的自动化测试
    第5章.测试驱动节点.js应用程序
    第6章.测试驱动Express应用程序
    第7章.使用DOM和jQuery
    Chapter 8. Using AngularJS
    Chapter 9. Test-Drive Angular 2
    第10章.端到端集成和测试
    Chapter 11. Test-Drive Your Apps

  • 下载电子版:下载地址
  • 购买纸质版:亚马逊商城

    点击星号评分!

    平均分 0 / 5. 投票数: 0

    还没有投票!请为他投一票。

  • 推荐阅读

    评论 抢沙发

    评论前必须登录!

     

    登录

    找回密码

    注册