Mastering React Test-Driven Development - Second Edition: Build simple and maintainable web apps with React, Redux, and GraphQL

Irvine, Daniel

  • 出版商: Packt Publishing
  • 出版日期: 2022-09-30
  • 售價: $1,610
  • 貴賓價: 9.5$1,530
  • 語言: 英文
  • 頁數: 564
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 1803247126
  • ISBN-13: 9781803247120
  • 相關分類: Web APIReactTDD 測試導向開發
  • 立即出貨 (庫存=1)

買這商品的人也買了...

商品描述

Learn test-driven and behavior-driven development techniques that will give you greater confidence when building React applications

 

Key Features:

  • Explore the TDD process, how it works, and why it will help you write maintainable React apps
  • Develop a component testing framework from scratch, which will help you understand the mechanics of good unit testing
  • Reduce complexity by using unit tests and end-to-end acceptance tests to drive the design of your apps

 

Book Description:

Test-driven development (TDD) is a programming workflow that helps you build your apps by specifying behavior as automated tests. The TDD workflow future-proofs apps so that they can be modified without fear of breaking existing functionality. Another benefit of TDD is that it helps software development teams communicate their intentions more clearly, by way of test specifications.

This book teaches you how to apply TDD when building React apps. You'll create a sample app using the same React libraries and tools that professional React developers use, such as Jest, React Router, Redux, Relay (GraphQL), Cucumber, and Puppeteer. The TDD workflow is supported by various testing techniques and patterns, which are useful even if you're not following the TDD process. This book covers these techniques by walking you through the creation of a component test framework. You'll learn automated testing theory which will help you work with any of the test libraries that are in standard usage today, such as React Testing Library. This second edition has been revised with a stronger focus on concise code examples and has been fully updated for React 18.

By the end of this TDD book, you'll be able to use React, Redux, and GraphQL to develop robust web apps.

 

What You Will Learn:

  • Build test-driven applications using React 18 and Jest
  • Understand techniques and patterns for writing great automated tests
  • Use test doubles and mocks effectively
  • Test-drive browser APIs, including the Fetch API and the WebSocket API
  • Integrate with libraries such as React Router, Redux, and Relay (GraphQL)
  • Use Cucumber.js and Puppeteer to build Behaviour- Driven Development (BDD) style tests for your applications
  • Build and test async Redux code using redux-saga and expect-redux

 

Who this book is for:

This book is for frontend developers who are looking to improve their testing practices and increase the quality and maintainability of their applications. To make the most of this book, you'll need knowledge of the JavaScript programming language.

商品描述(中文翻譯)

學習測試驅動和行為驅動開發技術,這將使您在構建React應用程序時更加自信。

主要特點:

- 探索TDD過程,了解其工作原理以及為什麼它有助於編寫可維護的React應用程序。
- 從頭開始開發一個組件測試框架,這將幫助您理解良好單元測試的機制。
- 通過使用單元測試和端到端接受測試來驅動應用程序設計,從而降低複雜性。

書籍描述:

測試驅動開發(TDD)是一種編程工作流程,通過自動化測試來指定行為,幫助您構建應用程序。TDD工作流程使應用程序具有未來可擴展性,可以在不擔心破壞現有功能的情況下進行修改。TDD的另一個好處是通過測試規範更清晰地傳達軟件開發團隊的意圖。

本書教您如何在構建React應用程序時應用TDD。您將使用與專業React開發人員相同的React庫和工具創建一個示例應用程序,例如Jest、React Router、Redux、Relay(GraphQL)、Cucumber和Puppeteer。TDD工作流程支持各種測試技術和模式,即使您不遵循TDD過程,這些技術和模式也很有用。本書通過引導您創建一個組件測試框架來介紹這些技術。您將學習自動化測試理論,這將幫助您使用當今常用的任何測試庫,例如React Testing Library。本書第二版更加注重簡潔的代碼示例,並已完全更新為React 18。

通過閱讀本書,您將能夠使用React、Redux和GraphQL開發強大的Web應用程序。

您將學到什麼:

- 使用React 18和Jest構建測試驅動的應用程序。
- 了解編寫優秀自動化測試的技巧和模式。
- 有效使用測試替身和模擬。
- 測試驅動瀏覽器API,包括Fetch API和WebSocket API。
- 整合React Router、Redux和Relay(GraphQL)等庫。
- 使用Cucumber.js和Puppeteer為應用程序構建行為驅動開發(BDD)風格的測試。
- 使用redux-saga和expect-redux構建和測試異步Redux代碼。

本書適合對前端開發人員,他們希望改進測試實踐,提高應用程序的質量和可維護性。為了充分利用本書,您需要具備JavaScript編程語言的知識。

作者簡介

Daniel Irvine is a UK-based software consultant. He helps businesses simplify their existing codebases and assists dev teams in improving the quality of their software using eXtreme programming (XP) practices. He has been coaching developers for many years and co-founded the Queer Code London meetup.

作者簡介(中文翻譯)

Daniel Irvine 是一位位於英國的軟體顧問。他協助企業簡化現有的程式碼庫,並協助開發團隊透過極限程式設計(XP)實踐來提升軟體品質。多年來,他一直在指導開發人員,並共同創辦了 Queer Code London meetup。

目錄大綱

  1. First Steps with Test-Driven Development
  2. Rendering Lists and Detail Views
  3. Refactoring the Test Suite
  4. Test-Driving Data Input
  5. Adding Complex Form Interactions
  6. Exploring Test Doubles
  7. Testing useEffect and Mocking Components
  8. Building an Application Component
  9. Form Validation
  10. Filtering and Searching Data
  11. Test-Driving React Router
  12. Test-Driving Redux
  13. Test-Driving GraphQL
  14. Building a Logo Interpreter
  15. Adding Animation
  16. Working with WebSockets
  17. Writing Your First Cucumber Test
  18. Adding Features Guided by Cucumber Tests
  19. Understanding TDD in the Wider Testing Landscape

目錄大綱(中文翻譯)


  1. 測試驅動開發的第一步

  2. 渲染列表和詳細視圖

  3. 重構測試套件

  4. 測試驅動數據輸入

  5. 添加複雜的表單交互

  6. 探索測試替身

  7. 測試 useEffect 和模擬組件

  8. 構建應用組件

  9. 表單驗證

  10. 數據過濾和搜索

  11. 測試驅動 React Router

  12. 測試驅動 Redux

  13. 測試驅動 GraphQL

  14. 構建一個 Logo 解釋器

  15. 添加動畫

  16. 使用 WebSockets

  17. 撰寫第一個 Cucumber 測試

  18. 根據 Cucumber 測試添加功能

  19. 在廣泛的測試環境中理解測試驅動開發