# meck

> Mocking library for Erlang

Source: https://talira.ai/catalog/meck-3j21y8sd
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 / erlang](https://talira.ai/categories/languages/erlang)
- Licence: Apache-2.0[^1]
- Pricing: Free and open source[^1]
- Pricing notes: Free and open source (Apache-2.0).
- Free tier: yes[^1]
- Backed by: [Adam Lindberg](https://talira.ai/orgs/eproxus.md)

meck replaces Erlang modules with mocks for tests. Expectations are added, merged and deleted at runtime, with argument matchers, sequences and loops of return values, passthrough to the original module and exceptions marked as intended. It keeps a full call history (calls, return values, exceptions and captured arguments), can wait for a call with a timeout, refuses to mock modules that don't exist unless told to, unloads mocks when the process that made them crashes, and can mock sticky modules and keep cover data. Install it from Hex as meck.

## Links

- Website: https://eproxus.github.io/meck
- GitHub: https://github.com/eproxus/meck
- Docs: https://hexdocs.pm/meck/

## Problems it solves

- replace an Erlang module with a fake in my unit tests
- check which arguments a function was called with in an Erlang test
- stub a dependency module's functions during EUnit or Common Test runs

## Features

- dynamic expectations added and removed at runtime
- argument matchers, return sequences and loops
- passthrough to the original module
- full call history with captured arguments
- wait for a call with a timeout
- automatic unload when the creating process crashes
- mocking of sticky modules
- cover data backup and restore

## Trust

Overall: 0.44 out of 1.
Signals: maintenance 0.53, adoption 0.59, momentum 0.22, community 0.75, backing 0.30, extensibility 0.00.

- last commit 46 days ago
- 12 commits in the last 90 days
- latest release v1.2.0 6 months ago
- 841 GitHub stars
- 76 contributors
- accepts sponsorship (Github, Liberapay)
- backed by Adam Lindberg

## Sources

[^1]: https://github.com/eproxus/meck/blob/master/LICENSE (checked 28 Nov 2026)
