# Repatch - Everything you need for mocking and patching

**URL:** <https://forum.elixirforum.com/t/repatch-everything-you-need-for-mocking-and-patching/66937>\
**Category:** Announcing\
**Tags:** library, testing, mocking, mocks, mock, patching, repatch\
**Created:** [October 22, 2024, 12:50pm UTC](https://forum.elixirforum.com/t/repatch-everything-you-need-for-mocking-and-patching/66937 "2024-10-22T12:50:59Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![Asd](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/c68b51/32.png) [@Asd](https://forum.elixirforum.com/u/Asd)\
**Post date:** [December 15, 2025, 11:55am UTC](https://forum.elixirforum.com/t/repatch-everything-you-need-for-mocking-and-patching/66937/16 "2025-12-15T11:55:18Z")

</div>

Hi, thanks for the feedback, I appreciate it

1. `isolate_env` option is an option to isolate application env. That’s to limit the scope of `Application.get_env` and `Application.put_env` functions. See [Repatch.Application — Repatch v1.6.1](https://hexdocs.pm/repatch/Repatch.Application.html)
2. You should pass a `mode` option to the `expect` call, like

```elixir
expect(Date, :utc_today, [mode: :shared, exactly: 2], fn -> ~D[2023-04-06] end)

```

So

- I will improve the documentation about this `isolate_env` option.

- And since I can see that you wanted to pass the default mode option on the `use Repatch.ExUnit` I think I will consider something like `default_mode` option, but I my biggest argument against this is that it is less explicit and reader of the test will be confused if this patch is local, shared or global unless they check one of the many line in the head of the module

Share your ideas if you have any

---

_[View the full topic](https://forum.elixirforum.com/t/repatch-everything-you-need-for-mocking-and-patching/66937)._
