Skip to content

Update dependency mimic to v2#23

Merged
pepicrft merged 1 commit intomainfrom
renovate/mimic-2.x
Apr 19, 2026
Merged

Update dependency mimic to v2#23
pepicrft merged 1 commit intomainfrom
renovate/mimic-2.x

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate bot commented Mar 24, 2026

This PR contains the following updates:

Package Type Update Change
mimic (source) dev major ~> 1.7~> 2.0

Release Notes

edgurgel/mimic (mimic)

v2.3.0

Compare Source

v2.2.0

Compare Source

v2.1.1

Compare Source

v2.1.0

Compare Source

v2.0.2

Compare Source

  • fix: Mimic.Module compilation when no options are stored. #​101

v2.0.1

Compare Source

  • Bump ham requirement

v2.0.0

Compare Source

Breaking changes

The code below would call the original Calculator.add/2 when all expectations were fulfilled.

 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 assert Calculator.add(1, 1) == 2

Now with Mimic 2 this will raise:

 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 Calculator.add(1, 1)

# Will raise error because more than 2 calls to Calculator.add were made and there is no stub
# ** (Mimic.UnexpectedCallError) Calculator.add/2 called in process #PID<.*> but expectations are already fulfilled

If there is a stub the stub will be called instead. This behaviour is the same as before.

 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)
 |> stub(:add, fn _, _ -> :stub end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 assert Calculator.add(1, 1) == :stub

Which means that if someone wants to keep the original behaviour on Mimic 1.* just do the following:

 Calculator
 |> expect(:add, fn _, _ -> :expected1 end)
 |> expect(:add, fn _, _ -> :expected2 end)
 |> stub(:add, fn x, y -> call_original(Calculator, :add, [x, y]) end)

 assert Calculator.add(1, 1) == :expected1
 assert Calculator.add(1, 1) == :expected2
 assert Calculator.add(1, 1) == 2

This way once all expectations are fulfilled the original function is called again.


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/mimic-2.x branch from c98f9b5 to 1478eee Compare March 24, 2026 17:02
@renovate renovate bot changed the title Update dependency mimic to v2 chore(deps): update dependency mimic to v2 Mar 25, 2026
@renovate renovate bot changed the title chore(deps): update dependency mimic to v2 Update dependency mimic to v2 Apr 8, 2026
@pepicrft pepicrft merged commit 7e95eef into main Apr 19, 2026
5 checks passed
@renovate renovate bot deleted the renovate/mimic-2.x branch April 19, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant