Stubs

A stub is a feature provided by some testing frameworks. Like spies, stubs also allow us to wrap a method or function to record its usage. Unlike in the case of spies, when we wrap a function with a stub, the underlying method's functionality is replaced with new behavior.

Get Learning TypeScript 2.x - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.