tdd - cccnqu/se107a GitHub Wiki

測試

單元測試

TDD/BDD 測試驅動開發

先寫測試案例,然後才寫被測試模組與函數。

Mocha -- 單元測試框架

Chai -- TDD, BDD 的檢查器

SuperTest -- 前端測試框架

istanbul -- 涵蓋度測試

debug -- 印除錯訊息與執行時間

測試爬蟲

講很多和測試有關的 Node.js 書: Node.js 实战心得

無顯示瀏覽器 (headless browser)

Puppeteer 的功能

  • Generate screenshots and PDFs of pages.
  • Crawl a SPA and generate pre-rendered content (i.e. "SSR").
  • Scrape content from websites.
  • Automate form submission, UI testing, keyboard input, etc.
  • Create an up-to-date, automated testing environment. Run your tests directly in the latest version of Chrome using the latest JavaScript and browser features.
  • Capture a timeline trace of your site to help diagnose performance issues.

Benchmark (花費時間報告,速度比較)

CI 持續整合

PC 端測試

手機 APP 測試