Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump patch from 0.13.1 to 0.14.0 (#921)
Bumps [patch](https://github.com/ihumanable/patch) from 0.13.1 to 0.14.0. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/ihumanable/patch/blob/master/CHANGELOG.md">patch's changelog</a>.</em></p> <blockquote> <h2>0.14.0 (2024-10-15)</h2> <p>Changes where mocks are evaluated to prevent misuse and allow for common patterns that were not previously supported.</p> <p>Pre-0.14.0 mocks would be intercepted by the <code>Patch.Mock.Server</code> and the mock value would be calculated by the server. This works for most cases, but has surprising behavior when the mock function cares about the process executing the function. Consider the following example.</p> <pre lang="elixir"><code>defmodule ExampleTest do use ExUnit.Case use Patch <p>test "example" do patch(Example, :get_pid, fn -> self() end)</p> <pre><code>assert Example.get_pid() == self() </code></pre> <p>end end </code></pre></p> <p>This would fail in pre-0.14.0 because the <code>fn -> self() end</code> would be executed by the <code>Patch.Mock.Server</code> and the pid returned would be the pid for the <code>Patch.Mock.Server</code> and not the caller's pid as the test author might expect.</p> <p>0.14.0 changes this behavior and now will execute the <code>fn -> self() end</code> in the caller and return the expected result.</p> <p>This also makes it much more difficult to address the <code>Patch.Mock.Server</code> directly, which is generally discouraged as this server is an implementation detail and should only be addressed by the Patch code itself. This should prevent a class of errors and confusing bugs caused by tests accidentally capturing the pid of, monitoring, or linking to the <code>Patch.Mock.Server</code></p> <h3>Improvements</h3> <ul> <li>⬆️ - [Internal] Mocks are now evaluated in the caller process instead of the <code>Patch.Mock.Server</code> process, see above for details.</li> </ul> <h3>Breaking Changes</h3> <ul> <li>💔 - Mocks are now evaluated in the caller process instead of the <code>Patch.Mock.Server</code> process. Using the <code>Patch.Mock.Server</code> pid or interacting with the process is not advised but if your tests relied on being able to do this they may break due to this change.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/ihumanable/patch/commits/v0.14.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=patch&package-manager=hex&previous-version=0.13.1&new-version=0.14.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details>
- Loading branch information