Skip to content

Commit

Permalink
test: adds case for Logger messages
Browse files Browse the repository at this point in the history
  • Loading branch information
grzuy committed Feb 6, 2025
1 parent 4b618cf commit ef612a4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/tower_error_tracker_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,18 @@ defmodule TowerErrorTrackerTest do
)
end

test "Logger messages not reported because not supported by ErrorTracker" do
in_unlinked_process(fn ->
require Logger

capture_log(fn ->
Logger.critical("Alarm!")
end)
end)

assert [] = TestApp.Repo.all(ErrorTracker.Error) |> TestApp.Repo.preload(:occurrences)
end

defp in_unlinked_process(fun) when is_function(fun, 0) do
{:ok, pid} = Task.Supervisor.start_link()

Expand Down

0 comments on commit ef612a4

Please sign in to comment.