Skip to content

Commit 1900e9f

Browse files
committed
update tests
1 parent 4ee5f27 commit 1900e9f

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

test/event_test.exs

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ defmodule Sentry.EventTest do
55

66
def event_generated_by_exception(extra \\ %{}) do
77
try do
8-
Event.not_a_function
8+
Event.not_a_function(1, 2, 3)
99
rescue
1010
e -> Event.transform_exception(e, [stacktrace: System.stacktrace, extra: extra])
1111
end
@@ -15,23 +15,24 @@ defmodule Sentry.EventTest do
1515
event = event_generated_by_exception()
1616

1717
assert event.platform == "elixir"
18-
assert event.culprit == "Sentry.Event.not_a_function()"
18+
assert event.culprit == "Sentry.Event.not_a_function/3"
1919
assert event.extra == %{}
2020
assert event.exception == [
2121
%{type: UndefinedFunctionError,
22-
value: "function Sentry.Event.not_a_function/0 is undefined or private",
22+
value: "function Sentry.Event.not_a_function/3 is undefined or private",
2323
module: nil}
2424
]
2525
assert event.level == "error"
26-
assert event.message == "(UndefinedFunctionError) function Sentry.Event.not_a_function/0 is undefined or private"
26+
assert event.message == "(UndefinedFunctionError) function Sentry.Event.not_a_function/3 is undefined or private"
2727
assert is_binary(event.server_name)
28-
assert event.stacktrace == %{frames: Enum.reverse([
29-
%{filename: nil, function: "Sentry.Event.not_a_function/0", lineno: nil, module: Sentry.Event, context_line: nil, post_context: [], pre_context: [], in_app: false},
30-
%{filename: "test/event_test.exs", function: "Sentry.EventTest.event_generated_by_exception/1", lineno: 8, module: Sentry.EventTest, context_line: nil, post_context: [], pre_context: [], in_app: false},
31-
%{filename: "test/event_test.exs", function: "Sentry.EventTest.\"test parses error exception\"/1", lineno: 15, module: Sentry.EventTest, context_line: nil, post_context: [], pre_context: [], in_app: false},
32-
%{filename: "lib/ex_unit/runner.ex", function: "ExUnit.Runner.exec_test/1", lineno: 302, module: ExUnit.Runner, context_line: nil, post_context: [], pre_context: [], in_app: false},
33-
%{filename: "timer.erl", function: ":timer.tc/1", lineno: 166, module: :timer, context_line: nil, post_context: [], pre_context: [], in_app: false},
34-
%{filename: "lib/ex_unit/runner.ex", function: "anonymous fn/3 in ExUnit.Runner.spawn_test/3", lineno: 250, module: ExUnit.Runner, context_line: nil, post_context: [], pre_context: [], in_app: false}])
28+
assert event.stacktrace == %{vars: %{"arg0" => "1", "arg1" => "2", "arg2" => "3"},
29+
frames: Enum.reverse([
30+
%{filename: nil, function: "Sentry.Event.not_a_function/3", lineno: nil, module: Sentry.Event, context_line: nil, post_context: [], pre_context: [], in_app: false},
31+
%{filename: "test/event_test.exs", function: "Sentry.EventTest.event_generated_by_exception/1", lineno: 8, module: Sentry.EventTest, context_line: nil, post_context: [], pre_context: [], in_app: false},
32+
%{filename: "test/event_test.exs", function: "Sentry.EventTest.\"test parses error exception\"/1", lineno: 15, module: Sentry.EventTest, context_line: nil, post_context: [], pre_context: [], in_app: false},
33+
%{filename: "lib/ex_unit/runner.ex", function: "ExUnit.Runner.exec_test/1", lineno: 302, module: ExUnit.Runner, context_line: nil, post_context: [], pre_context: [], in_app: false},
34+
%{filename: "timer.erl", function: ":timer.tc/1", lineno: 166, module: :timer, context_line: nil, post_context: [], pre_context: [], in_app: false},
35+
%{filename: "lib/ex_unit/runner.ex", function: "anonymous fn/3 in ExUnit.Runner.spawn_test/3", lineno: 250, module: ExUnit.Runner, context_line: nil, post_context: [], pre_context: [], in_app: false}])
3536
}
3637
assert event.tags == %{}
3738
assert event.timestamp =~ ~r/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/
@@ -83,7 +84,9 @@ defmodule Sentry.EventTest do
8384
event = Sentry.Event.transform_exception(exception, [stacktrace: [{Elixir.Sentry.Fun, :method, 2, []}, {Elixir.Sentry, :other_method, 4, []},
8485
{:other_module, :a_method, 8, []}, {:random, :uniform, 0, []},
8586
{Sentry.Submodule.Fun, :this_method, 0, []}]])
86-
assert %{frames: [
87+
assert %{
88+
vars: %{},
89+
frames: [
8790
%{
8891
module: Sentry.Submodule.Fun,
8992
function: "Sentry.Submodule.Fun.this_method/0",

0 commit comments

Comments
 (0)