Test-Driving JavaScript Applications: Rapid, Confident, Maintainable Code
暫譯: 測試驅動的 JavaScript 應用程式:快速、自信、可維護的程式碼
Venkat Subramaniam
- 出版商: Pragmatic Bookshelf
- 出版日期: 2016-11-15
- 售價: $1,310
- 貴賓價: 9.5 折 $1,245
- 語言: 英文
- 頁數: 364
- 裝訂: Paperback
- ISBN: 1680501747
- ISBN-13: 9781680501742
-
相關分類:
JavaScript
-
相關翻譯:
JavaScript測試驅動開發 (簡中版)
立即出貨
買這商品的人也買了...
-
$1,200$948 -
$580$452 -
$595$565 -
$780$616 -
$820$648 -
$590$466 -
$480$379 -
$580$458 -
$699$552 -
$354$336 -
$580$458 -
$420$332 -
$450$356 -
$520$411 -
$450$315 -
$480$379 -
$590$502 -
$680$537 -
$500$395 -
$580$458 -
$403TensorFlow 實戰
-
$403Tensorflow:實戰Google深度學習框架
-
$480$379 -
$680$537 -
$320$250
商品描述
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.
商品描述(中文翻譯)
揭穿「JavaScript 不易測試」的迷思。無論您使用 Node.js、Express、MongoDB、jQuery、AngularJS,或是直接操作 DOM,您都可以進行 JavaScript 的測試驅動開發。學習使用 Karma、Mocha 和 Chai 撰寫有意義且可預測的自動化測試的技藝。測試非同步 JavaScript,解耦並正確模擬依賴,測量程式碼覆蓋率,並創建輕量級的模組化設計,無論是伺服器端還是客戶端的程式碼。您在撰寫測試上的投資將帶來高回報,因為您將創建可預測且變更成本低的程式碼。
設計和編寫具有自動化測試的 JavaScript 應用程式。撰寫有意義的測試是一項需要學習、一些重學和大量練習的技能,而這本書將幫助您磨練這項技能。啟動編輯器,通過實踐練習進行有效的自動化測試和設計可維護的模組化程式碼。
首先學習何時以及為什麼要進行手動測試與自動化驗證。將測試重點放在重要的事物上,例如前置條件、不變式、複雜邏輯和棘手的邊界情況。然後開始使用自動化測試設計非同步函數。仔細解耦並模擬複雜的依賴,例如 DOM、地理位置 API、檔案和資料庫存取,以及對遠端伺服器的 Ajax 呼叫。
逐步測試使用 Node.js、Express、MongoDB、jQuery 和 AngularJS 的程式碼。了解何時以及如何使用 Chai、Istanbul、Karma、Mocha、Protractor 和 Sinon 等工具。以最小的努力創建測試,並快速運行它們,而無需啟動網頁伺服器或手動編輯 HTML 頁面以在瀏覽器中運行。然後探索端到端測試,以確保所有部分都正確連接並良好運作。
不要只是想像創建可測試的程式碼,實際撰寫它。
您需要的:
一台配有文本編輯器和您最喜愛的瀏覽器的電腦。本書提供安裝必要的自動化測試相關工具的指導。