# mockito

> Mock library for Dart, inspired by Java's Mockito

Source: https://talira.ai/catalog/mockito-pccr92at
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [developer tools / testing / mocking](https://talira.ai/categories/developer-tools/testing/mocking), [languages / dart](https://talira.ai/categories/languages/dart)
- Licence: Apache-2.0[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Google](https://talira.ai/orgs/google.md)
- Funding: public company (NASDAQ:GOOGL)[^2]

mockito is the Dart team's mock library for Dart and Flutter tests, inspired by Java's [Mockito](https://talira.ai/catalog/mockito-19c1938g.md). With null safety it generates mock classes with build_runner from @GenerateNiceMocks annotations, then stubs methods, verifies calls and captures arguments; it also has APIs for fakes.

## Links

- GitHub: https://github.com/dart-lang/build
- Docs: https://pub.dev/documentation/mockito/latest/

## Problems it solves

- mock a dependency in my Dart unit tests
- verify that my Flutter code called a method with the right arguments
- stub a repository class in Dart tests without writing a fake by hand

## Features

- generated mock classes with build_runner
- stubbing and behaviour verification
- argument matchers and captors
- fakes for classes you don't want to mock

## Trust

Overall: 0.66 out of 1.
Signals: maintenance 1.00, adoption 0.59, momentum 0.27, community 0.87, backing 0.55, extensibility 0.00.

- last commit 5 days ago
- 142 commits in the last 90 days
- latest release built_collection-v6.0.0 40 days ago
- 871 GitHub stars
- 145 contributors
- backed by Google
- funding: public company (NASDAQ:GOOGL)

## Alternatives

- [mocktail](https://talira.ai/catalog/mocktail-99grf8ee.md): Mocks for Dart and Flutter tests without code generation

## Sources

[^1]: https://github.com/dart-lang/build/blob/master/builder_pkgs/mockito/LICENSE (checked 26 Nov 2026)
[^2]: https://www.sec.gov/files/company_tickers_exchange.json (checked 20 Nov 2026)
