Skip to main content

ts-mockito

Mocking library for TypeScript inspired by Mockito

npm install @typestrong/ts-mockito --save-dev
🦾

Strongly Typed

Mocks, stubs, and argument matchers are all backed by TypeScript's type system, with full IDE autocomplete.

💖

A Familiar Mockito API

mock, when, and verify bring the readable, expressive mocking style of Java's Mockito to TypeScript.

🔎

Spy on Real Objects

Partially mock a real instance with spy, stubbing only the methods you need while the rest call through to the real implementation.