Sinon.JS

Sinon.JS is a library that provides us with a set of APIs that can help us to test a component in isolation, thanks to its usage of spies, stubs, and mocks. Testing software components can be very difficult when there is a high level of coupling between them. However, a library such as Sinon.JS can help us isolate the components to test their features. We can install Sinon.JS using the following command:

npm install --save-dev sinon @types/sinon  

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.