Update Wallaby to 0.30.10 and suppress expected test error
- Update Wallaby from 0.30.0 to 0.30.10 to fix struct update deprecation warnings - Suppress expected error output in BroadcastTaskSupervisor test using capture_log - Keeps test output clean while still verifying error handling behavior
This commit is contained in:
parent
ef162bab37
commit
ee16f81ed9
2 changed files with 12 additions and 8 deletions
2
mix.exs
2
mix.exs
|
|
@ -108,7 +108,7 @@ defmodule Aprsme.MixProject do
|
||||||
{:cachex, "~> 4.1"},
|
{:cachex, "~> 4.1"},
|
||||||
{:gettext_pseudolocalize, "~> 0.1"},
|
{:gettext_pseudolocalize, "~> 0.1"},
|
||||||
{:sentry, "~> 11.0"},
|
{:sentry, "~> 11.0"},
|
||||||
{:wallaby, "~> 0.30.0", only: :test}
|
{:wallaby, "~> 0.30.10", only: :test}
|
||||||
# Gleam dependencies
|
# Gleam dependencies
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
defmodule Aprsme.BroadcastTaskSupervisorTest do
|
defmodule Aprsme.BroadcastTaskSupervisorTest do
|
||||||
use ExUnit.Case, async: true
|
use ExUnit.Case, async: true
|
||||||
|
import ExUnit.CaptureLog
|
||||||
|
|
||||||
alias Aprsme.BroadcastTaskSupervisor
|
alias Aprsme.BroadcastTaskSupervisor
|
||||||
|
|
||||||
|
|
@ -89,14 +90,17 @@ defmodule Aprsme.BroadcastTaskSupervisorTest do
|
||||||
end
|
end
|
||||||
|
|
||||||
test "handles errors in async functions gracefully" do
|
test "handles errors in async functions gracefully" do
|
||||||
# This should not crash the supervisor
|
# Capture logs to suppress the expected error output
|
||||||
{:ok, _pid} =
|
capture_log(fn ->
|
||||||
BroadcastTaskSupervisor.async_execute(fn ->
|
# This should not crash the supervisor
|
||||||
raise "Test error"
|
{:ok, _pid} =
|
||||||
end)
|
BroadcastTaskSupervisor.async_execute(fn ->
|
||||||
|
raise "Test error"
|
||||||
|
end)
|
||||||
|
|
||||||
# Give it time to fail - reduced from 50ms to 10ms
|
# Give it time to fail - reduced from 50ms to 10ms
|
||||||
Process.sleep(10)
|
Process.sleep(10)
|
||||||
|
end)
|
||||||
|
|
||||||
# Supervisor should still be running
|
# Supervisor should still be running
|
||||||
stats = BroadcastTaskSupervisor.get_stats()
|
stats = BroadcastTaskSupervisor.get_stats()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue