Jasmine JavaScript Testing
暫譯: Jasmine JavaScript 測試
Paulo Ragonha
- 出版商: Packt Publishing
- 出版日期: 2013-08-24
- 售價: $1,500
- 貴賓價: 9.5 折 $1,425
- 語言: 英文
- 頁數: 146
- 裝訂: Paperback
- ISBN: 178216720X
- ISBN-13: 9781782167204
-
相關分類:
JavaScript
海外代購書籍(需單獨結帳)
商品描述
If you want to take your JavaScript coding to a new level of reliability and proficiency, this book is for you. Discover how to use Jasmine for unit testing whilst learning best practice for the whole JavaScript universe.
Overview
- Learn the power of test-driven development while creating a fully-featured web application
- Understand the best practices for modularization and code organization while putting your application to scale
- Leverage the power of frameworks such as BackboneJS and jQuery while maintaining the code quality
- Automate everything from spec execution to build; leave repetition to the monkeys
In Detail
From a little renegade scripting language to the de facto standard platform of today, JavaScript has become a universal language available in the widest range of devices; it is truly the 'write once, run everywhere’ language. However, as JavaScript applications become more complicated, testing and applying sustainable software engineering practices also become mandatory.
Jasmine JavaScript Testing is a practical guide to a more sustainable JavaScript development process. You will learn by example how to drive the development of a web application using tests and best practices.
This book is about becoming a better JavaScript developer. So, throughout the chapters, you will not only learn about writing tests, but also about the best practices for writing software in the JavaScript language. This book is about acknowledging JavaScript as a real platform for application development and leveraging all of its potential. You will also learn about tooling and automation and how to make your life easier and more productive.
You will learn how to create a sustainable codebase with the help of Jasmine. We will take a look at integrated testing (with a backend NodeJS server) and how you can speed this process up by faking AJAX requests. As you progress through the book, you will learn about the challenges of testing an application built on top of a framework and how you can prevent your application from suffering from dependency management hell. Also, since your applications need to get into production, you will learn about optimizing the code to reduce the number of requests the browser needs to make while loading your application.
With this book, you will learn everything you need to know to become a real professional in the ever-demanding JavaScript universe.
What you will learn from this book
- Drive your application development entirely by tests
- Organize your application code in modules with RequireJS
- Create a fully-tested jQuery plugin
- Solve problems and learn best practices for asynchronous testing
- Use Stubs and Spies to perform quick unit testing
- Test-drive a BackboneJS application
- Optimize your JavaScript code to production
- Master the power of tooling and automation with GruntJS
- Run your tests on the cloud with Travis-CI
Approach
The book uses a concise, to-the-point approach to help developers understand and use the power of Jasmine to create better and more maintainable codebases.
Who this book is written for
This book is a must-have guide for web developers who are new to the concept of unit testing. It’s assumed that you have a basic knowledge of JavaScript and HTML.
商品描述(中文翻譯)
如果您想將您的 JavaScript 編碼提升到新的可靠性和熟練度,這本書就是為您而寫的。發現如何使用 Jasmine 進行單元測試,同時學習整個 JavaScript 生態系統的最佳實踐。
**概述**
- 學習測試驅動開發的力量,同時創建一個功能齊全的網頁應用程式
- 理解模組化和代碼組織的最佳實踐,並使您的應用程式具備擴展性
- 利用 BackboneJS 和 jQuery 等框架的力量,同時保持代碼質量
- 自動化從規範執行到構建的所有過程;將重複的工作留給機器人
**詳細內容**
從一個小型的叛逆腳本語言到今天的事實標準平台,JavaScript 已經成為一種可在最廣泛設備上使用的通用語言;它確實是“寫一次,隨處運行”的語言。然而,隨著 JavaScript 應用程式變得越來越複雜,測試和應用可持續的軟體工程實踐也變得必不可少。
Jasmine JavaScript 測試是一本實用指南,旨在提供更可持續的 JavaScript 開發過程。您將通過範例學習如何使用測試和最佳實踐推動網頁應用程式的開發。
這本書的目的是讓您成為一名更好的 JavaScript 開發者。因此,在各章中,您不僅會學習如何編寫測試,還會學習在 JavaScript 語言中編寫軟體的最佳實踐。這本書旨在承認 JavaScript 作為應用程式開發的真正平台,並利用其所有潛力。您還將學習工具和自動化,並了解如何讓您的生活更輕鬆、更高效。
您將學習如何在 Jasmine 的幫助下創建一個可持續的代碼庫。我們將探討集成測試(使用後端 NodeJS 伺服器)以及如何通過模擬 AJAX 請求來加快此過程。隨著您在書中的進展,您將了解在框架上構建應用程式的測試挑戰,以及如何防止您的應用程式遭受依賴管理地獄。此外,由於您的應用程式需要投入生產,您將學習如何優化代碼,以減少瀏覽器在加載應用程式時所需的請求數量。
通過這本書,您將學習成為在不斷要求的 JavaScript 生態系統中真正專業人士所需的所有知識。
**您將從這本書中學到什麼**
- 完全通過測試推動您的應用程式開發
- 使用 RequireJS 將您的應用程式代碼組織成模組
- 創建一個經過全面測試的 jQuery 插件
- 解決問題並學習異步測試的最佳實踐
- 使用 Stubs 和 Spies 進行快速單元測試
- 測試驅動 BackboneJS 應用程式
- 將您的 JavaScript 代碼優化到生產環境
- 精通 GruntJS 的工具和自動化的力量
- 在雲端使用 Travis-CI 運行您的測試
**方法**
本書採用簡潔明瞭的方法,幫助開發者理解並利用 Jasmine 的力量來創建更好且更易於維護的代碼庫。
**本書的讀者**
這本書是新手網頁開發者必備的指南,特別是對單元測試概念不熟悉的開發者。假設您對 JavaScript 和 HTML 有基本的了解。