Tagged in

Unit Testing

hefemk
hefemk
Technical blog
More information
Followers
7
Elsewhere
More, on Medium

去除 Jasmine Spy 回傳值

過去我曾在文章「Jasmine 測試當中建立假物件的小技巧」介紹 Jasmine.Spy 系列方法,提到 Spy 可以幫助提高測試的「靈活度」與「可測性」,這樣的說法是基於 Spy 擁有「改變結果」與「觀察」的能力。


用 Angular Component 來理解 Mock 與 Stub

Stub VS. Mock

這兩個名詞時常混淆,摘錄在 Stake overflow 看到的簡潔說明 (Ref.)。

A stub is a simple fake object. It just makes sure test runs smoothly.
A mock is a smarter stub. You verify your test passes through it.