Svelte with Test-Driven Development: Advance your skills and write effective automated tests with Vitest, Playwright, and Cucumber.js
暫譯: 使用測試驅動開發的 Svelte:提升技能並使用 Vitest、Playwright 和 Cucumber.js 撰寫有效的自動化測試

Irvine, Daniel

  • 出版商: Packt Publishing
  • 出版日期: 2023-06-30
  • 售價: $1,400
  • 貴賓價: 9.5$1,330
  • 語言: 英文
  • 頁數: 250
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 1837638330
  • ISBN-13: 9781837638338
  • 相關分類: TDD 測試導向開發
  • 立即出貨 (庫存=1)

商品描述

Build robust and performant applications by developing SvelteKit applications using automated testing and TDD techniques, including unit and end-to-end testing, custom matchers, component mocking, and authentication

Purchase of the print or Kindle book includes a free PDF eBook


Key Features:

  • Understand and master the test-driven development (TDD) workflow
  • Explore the principles of unit testing with Vitest and end-to-end testing using Playwright and Cucumber.js
  • Leverage practical examples of unit tests covering a range of SvelteKit framework features


Book Description:

Svelte is a popular front-end framework used for its focus on performance and user-friendliness, and test-driven development (TDD) is a powerful approach that helps in creating automated tests before writing code. By combining them, you can create efficient, maintainable code for modern applications. Svelte with Test-Driven Development will help you learn effective automated testing practices to build and maintain Svelte applications.

In the first part of the book, you'll find a guided walkthrough on building a SvelteKit application using the TDD workflow. You'll uncover the main concepts for writing effective unit test cases and practical advice for developing solid, maintainable test suites that can speed up application development while remaining effective as the application evolves. In the next part of the book, you'll focus on refactoring and advanced test techniques, such as using component mocks and writing BDD-style tests with the Cucumber.js framework. In the final part of the book, you'll explore how to test complex application and framework features, including authentication, Svelte stores, and service workers.

By the end of this book, you'll be well-equipped to build test-driven Svelte applications by employing theoretical and practical knowledge.


What You Will Learn:

  • Create clear and concise Vitest unit tests helping the implementation of Svelte components
  • Use Playwright and Cucumber.js to develop end-to-end tests that simulate user interactions and test the functionality of your application
  • Leverage component mocks to isolate and test individual components
  • Write unit tests for a range of Svelte framework features
  • Explore effective refactoring techniques to keep your Svelte application code and test suites clean
  • Build high-quality Svelte applications that are well-tested, performant, and resilient to changes


Who this book is for:

This book is an essential guide for Svelte developers seeking to enhance their development process by learning the TDD workflow and its application. Whether you are an experienced developer or new to automated testing, this book helps you gain a practical approach to improving your workflow. The examples are written in JavaScript, making them accessible to all developers, including TypeScript developers.

商品描述(中文翻譯)

透過使用自動化測試和測試驅動開發(TDD)技術來開發 SvelteKit 應用程式,建立穩健且高效能的應用程式,包括單元測試和端對端測試、自訂匹配器、元件模擬和身份驗證

購買印刷版或 Kindle 書籍可獲得免費 PDF 電子書

主要特色:


  • 理解並掌握測試驅動開發(TDD)工作流程

  • 探索使用 Vitest 的單元測試原則和使用 Playwright 及 Cucumber.js 的端對端測試

  • 利用涵蓋多種 SvelteKit 框架功能的單元測試實務範例

書籍描述:
Svelte 是一個受歡迎的前端框架,因其專注於效能和使用者友好性而受到廣泛使用,而測試驅動開發(TDD)是一種強大的方法,幫助在編寫程式碼之前創建自動化測試。通過將它們結合,您可以為現代應用程式創建高效且可維護的程式碼。《Svelte 與測試驅動開發》將幫助您學習有效的自動化測試實踐,以構建和維護 Svelte 應用程式。

在本書的第一部分,您將找到使用 TDD 工作流程構建 SvelteKit 應用程式的指導步驟。您將揭示撰寫有效單元測試案例的主要概念,以及開發穩固、可維護的測試套件的實用建議,這些測試套件可以加速應用程式開發,同時在應用程式演變時保持有效。在本書的下一部分,您將專注於重構和進階測試技術,例如使用元件模擬和使用 Cucumber.js 框架撰寫 BDD 風格的測試。在本書的最後部分,您將探索如何測試複雜的應用程式和框架功能,包括身份驗證、Svelte stores 和服務工作者。

在本書結束時,您將能夠運用理論和實踐知識來構建測試驅動的 Svelte 應用程式。

您將學到的內容:


  • 創建清晰且簡潔的 Vitest 單元測試,幫助實現 Svelte 元件

  • 使用 Playwright 和 Cucumber.js 開發模擬使用者互動並測試應用程式功能的端對端測試

  • 利用元件模擬來隔離和測試單個元件

  • 為多種 Svelte 框架功能撰寫單元測試

  • 探索有效的重構技術,以保持您的 Svelte 應用程式程式碼和測試套件的整潔

  • 構建高品質的 Svelte 應用程式,這些應用程式經過良好測試、高效能且能抵抗變更

本書適合誰:
本書是 Svelte 開發者的必備指南,旨在通過學習 TDD 工作流程及其應用來提升開發過程。無論您是經驗豐富的開發者還是自動化測試的新手,本書都將幫助您獲得改善工作流程的實用方法。範例使用 JavaScript 編寫,使所有開發者(包括 TypeScript 開發者)都能輕鬆理解。