File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -48,14 +48,19 @@ defmodule Mix.Tasks.Sentry.SendTestEventTest do
4848 """
4949 end
5050
51- test "handles :error when Sentry server is unreachable" do
52- modify_env ( :sentry , [ dsn: "http://public:secret@localhost:0/1" ] )
51+ test "handles :error when Sentry server is failing" do
52+ bypass = Bypass . open
53+ Bypass . expect bypass , fn conn ->
54+ { :ok , _body , conn } = Plug.Conn . read_body ( conn )
55+ Plug.Conn . resp ( conn , 500 , ~s< {"id": "340"}> )
56+ end
57+ modify_env ( :sentry , [ dsn: "http://public:secret@localhost:#{ bypass . port } /1" ] )
5358 assert capture_log ( fn ->
5459 assert capture_io ( fn ->
5560 Mix.Tasks.Sentry.SendTestEvent . run ( [ ] )
5661 end ) == """
5762 Client configuration:
58- server: http://localhost:0 /api/1/store/
63+ server: http://localhost:#{ bypass . port } /api/1/store/
5964 public_key: public
6065 secret_key: secret
6166 included_environments: [:test]
You can’t perform that action at this time.
0 commit comments