Skip to content

Commit

Permalink
test: ErrorTracker.set_context
Browse files Browse the repository at this point in the history
  • Loading branch information
grzuy committed Jan 20, 2025
1 parent 8fce80e commit e7ce7be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions test/support/error_test_plug.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ defmodule TowerErrorTracker.ErrorTestPlug do
plug(:dispatch)

get "/arithmetic-error" do
ErrorTracker.set_context(%{user_id: 123})

1 / 0

Check warning on line 10 in test/support/error_test_plug.ex

View workflow job for this annotation

GitHub Actions / main (1.15, 25.3.2.16, error_tracker_0_3)

the call to //2 will fail with ArithmeticError

Check warning on line 10 in test/support/error_test_plug.ex

View workflow job for this annotation

GitHub Actions / main (1.15, 25.3.2.16, error_tracker_0_3)

the result of evaluating operator '/'/2 is ignored (suppress the warning by assigning the expression to the _ variable)

Check warning on line 10 in test/support/error_test_plug.ex

View workflow job for this annotation

GitHub Actions / main (1.15, 25.3.2.16, error_tracker_0_3)

the call to //2 will fail with ArithmeticError

Check warning on line 10 in test/support/error_test_plug.ex

View workflow job for this annotation

GitHub Actions / main (1.15, 25.3.2.16, error_tracker_0_3)

the result of evaluating operator '/'/2 is ignored (suppress the warning by assigning the expression to the _ variable)

send_resp(conn, 200, "OK")
Expand Down
3 changes: 2 additions & 1 deletion test/tower_error_tracker_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ defmodule TowerErrorTrackerTest do
"request" => %{
"method" => "GET",
"url" => ^url
}
},
"user_id" => 123
}
}
]
Expand Down

0 comments on commit e7ce7be

Please sign in to comment.