Svelte with Test-Driven Development: Advance your skills and write effective automated tests with Vitest, Playwright, and 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 with Test-Driven Development》將幫助您學習有效的自動化測試實踐,以構建和維護Svelte應用程式。

在書籍的第一部分中,您將找到一個引導式的步驟,介紹使用TDD工作流程構建SvelteKit應用程式。您將了解編寫有效單元測試案例的主要概念,以及開發堅固且易於維護的測試套件的實用建議,這些測試套件可以加快應用程式開發速度,同時在應用程式演進時保持有效。在書籍的下一部分中,您將專注於重構和高級測試技術,例如使用元件模擬和使用Cucumber.js框架編寫BDD風格的測試。在書籍的最後一部分中,您將探索如何測試複雜的應用程式和框架功能,包括身份驗證、Svelte存儲和服務工作者。

通過閱讀本書,您將具備理論和實踐知識,能夠使用測試驅動的方式構建Svelte應用程式。

學到什麼:
- 創建清晰簡潔的Vitest單元測試,幫助實現Svelte元件
- 使用Playwright和Cucumber.js開發端對端測試,模擬用戶互動並測試應用程式功能
- 利用元件模擬來隔離和測試個別元件
- 為各種Svelte框架功能編寫單元測試
- 探索有效的重構技術,保持Svelte應用程式代碼和測試套件的整潔
- 構建高質量的Svelte應用程式,具有良好的測試、高性能和對變更具有彈性的特性

本書適合尋求通過學習TDD工作流程和應用程式來增強Svelte開發流程的開發人員。無論您是有經驗的開發人員還是新手自動化測試,本書都能幫助您獲得改進工作流程的實用方法。範例使用JavaScript編寫,適用於所有開發人員,包括TypeScript開發人員。