ts-mockito
JSON →ts-mockito is a comprehensive mocking library for TypeScript, drawing inspiration from the well-known Java Mockito.org framework. Currently stable at version 2.6.1, it provides strongly typed mocks that enhance unit testing with features such as automatic IDE autocompletion and clear, readable error messages. The library allows for mocking classes, abstract classes, and interfaces, spying on real objects, and offers extensive stubbing capabilities including returning values, throwing errors, resolving/rejecting promises, and executing custom functions. ts-mockito maintains a moderate release cadence, with several updates annually focusing on new features and bug fixes. Its key differentiators include robust TypeScript integration, advanced verification options like call count, order, and argument capturing, and recent enhancements like improved type checking for the `deepEqual` matcher and multi-mock resetting.
Traffic · last 30 days ↓50% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany · 🇫🇷 France