Mocks and Stubs

Packages that help with mocking and stubbing in tests

mox

Recently Committed
9.1

Mocks and explicit contracts for Elixir

1.4K 1.1M/wk v1.2.0 1y ago 14d ago

mox

Recently Committed
9.1
Mocks and explicit contracts for Elixir
Popularity
1,391 ★
73 forks · 17 watching
Activity
6 issues
2 open PRs · 82 merged
Downloads
1,068,219/wk
18,728 yesterday · 28.1M total
Release
v1.2.0
August 14, 2024

meck

Recently Committed
6.6

A mocking framework for Erlang

833 1.2M/wk v1.1.0 4mo ago 3d ago

meck

Recently Committed
6.6
A mocking framework for Erlang
erlang testing mocking-library meck
Popularity
833 ★
213 forks · 28 watching
Activity
10 issues
3 open PRs · 92 merged
Downloads
1,216,205/wk
22,878 yesterday · 65.6M total
Release
v1.1.0
October 12, 2025

mock

4.8

A mocking library for the Elixir language. We use the Erlang meck library to provide module mocking functionality for Elixir. It uses macros in Elixir to expose the functionality in a convenient manner for integrating in Elixir tests.

690 549.5K/wk v0.3.9 1y ago 1y ago

mock

4.8
A mocking library for the Elixir language. We use the Erlang meck library to provide module mocking functionality for Elixir. It uses macros in Elixir to expose the functionality in a convenient manner for integrating in Elixir tests.
Popularity
690 ★
79 forks · 10 watching
Activity
20 issues
3 open PRs · 72 merged
Downloads
549,536/wk
9,487 yesterday · 19.6M total
Release
v0.3.9
December 16, 2024

hammox

3.8

Automated contract testing for functions and mocks.

587 244.7K/wk v0.7.1 7mo ago 7mo ago

hammox

3.8
Automated contract testing for functions and mocks.
elixir testing mock mox contract-testing typechecker typechecking typespec dialyzer contracts behaviours contract behaviour behaviour-typespec unit-testing typespecs mocks explicit-contracts type-checking type-checker
Popularity
587 ★
30 forks · 1 watching
Activity
12 issues
5 open PRs · 84 merged
Downloads
244,735/wk
3,640 yesterday · 4.2M total
Release
v0.7.1
July 26, 2025

mockery

0.6

Simple mocking library for asynchronous testing.

94 139.6K/wk v2.5.0 5mo ago 5mo ago

mockery

0.6
Simple mocking library for asynchronous testing.
elixir-lang elixir exunit asynchronous-tests mock-library mocking testing unit-testing async-true
Popularity
94 ★
10 forks · 1 watching
Activity
0 issues
0 open PRs · 83 merged
Downloads
139,626/wk
1,786 yesterday · 2.3M total
Release
v2.5.0
September 24, 2025

mecks_unit

0.4

A simple Elixir package to elegantly mock module functions within (asynchronous) ExUnit tests using Erlang's :meck library

54 955/wk v0.1.9 5y ago 5y ago

mecks_unit

0.4
A simple Elixir package to elegantly mock module functions within (asynchronous) ExUnit tests using Erlang's :meck library
elixir mocking exunit meck asynchronous elegant
Popularity
54 ★
7 forks · 5 watching
Activity
1 issues
0 open PRs · 0 merged
Downloads
955/wk
14 yesterday · 71.5K total
Release
v0.1.9
April 19, 2020

em

0.2

An EasyMock inspired mocking library for erlang.

23 676/wk v7.3.0 2y ago 2y ago

em

0.2
An EasyMock inspired mocking library for erlang.
Popularity
23 ★
8 forks · 3 watching
Activity
1 issues
0 open PRs · 7 merged
Downloads
676/wk
1 yesterday · 25.0K total
Release
v7.3.0
March 28, 2023

placebo

0.1

A mocking library for ExUnit inspired by RSpec and based on meck.

15 1.3K/wk v2.0.0 5y ago 2y ago

placebo

0.1
A mocking library for ExUnit inspired by RSpec and based on meck.
Popularity
15 ★
1 forks · 2 watching
Activity
0 issues
0 open PRs · 18 merged
Downloads
1,287/wk
77 yesterday · 152.4K total
Release
v2.0.0
December 05, 2020

ex_meck

0.0

A mocking library particularly suitable for stateful property based testing.

2 12.7K/wk v0.3.0 6y ago 5y ago

ex_meck

0.0
A mocking library particularly suitable for stateful property based testing.
Popularity
2 ★
4 forks · 1 watching
Activity
0 issues
0 open PRs · 5 merged
Downloads
12,669/wk
249 yesterday · 845.7K total
Release
v0.3.0
December 01, 2019

ex_mock

0.0

A mocking libary for the Elixir language. We use the Erlang meck library to provide module mocking functionality for Elixir. It uses macros in Elixir to expose the functionality in a convenient manner for integrating in Elixir tests.

1 1.0K/wk v0.1.1 8y ago 8y ago

ex_mock

0.0
A mocking libary for the Elixir language. We use the Erlang meck library to provide module mocking functionality for Elixir. It uses macros in Elixir to expose the functionality in a convenient manner for integrating in Elixir tests.
Popularity
1 ★
0 forks · 1 watching
Activity
0 issues
0 open PRs · 0 merged
Downloads
1,039/wk
19 yesterday · 50.3K total
Release
v0.1.1
June 01, 2017