Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps-dev): bump patch from 0.13.1 to 0.14.0 #1336

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Oct 21, 2024

Bumps patch from 0.13.1 to 0.14.0.

Changelog

Sourced from patch's changelog.

0.14.0 (2024-10-15)

Changes where mocks are evaluated to prevent misuse and allow for common patterns that were not previously supported.

Pre-0.14.0 mocks would be intercepted by the Patch.Mock.Server 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.

defmodule ExampleTest do
  use ExUnit.Case
  use Patch
test "example" do
patch(Example, :get_pid, fn -> self() end)
assert Example.get_pid() == self()

end
end

This would fail in pre-0.14.0 because the fn -> self() end would be executed by the Patch.Mock.Server and the pid returned would be the pid for the Patch.Mock.Server and not the caller's pid as the test author might expect.

0.14.0 changes this behavior and now will execute the fn -> self() end in the caller and return the expected result.

This also makes it much more difficult to address the Patch.Mock.Server 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 Patch.Mock.Server

Improvements

  • ⬆️ - [Internal] Mocks are now evaluated in the caller process instead of the Patch.Mock.Server process, see above for details.

Breaking Changes

  • 💔 - Mocks are now evaluated in the caller process instead of the Patch.Mock.Server process. Using the Patch.Mock.Server 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.
Commits

Dependabot compatibility score

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 commands and options

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)

Bumps [patch](https://github.com/ihumanable/patch) from 0.13.1 to 0.14.0.
- [Changelog](https://github.com/ihumanable/patch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ihumanable/patch/commits/v0.14.0)

---
updated-dependencies:
- dependency-name: patch
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot requested a review from a team as a code owner October 21, 2024 17:38
@dependabot dependabot bot added dependencies Pull requests that update a dependency file elixir Pull requests that update Elixir code labels Oct 21, 2024
@rodrigo-o rodrigo-o merged commit 84fea67 into main Oct 21, 2024
16 checks passed
@rodrigo-o rodrigo-o deleted the dependabot/hex/patch-0.14.0 branch October 21, 2024 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file elixir Pull requests that update Elixir code
Projects
Development

Successfully merging this pull request may close these issues.

1 participant