Skip to content

Commit

Permalink
Link module documentation of leave and close crashing the test pr…
Browse files Browse the repository at this point in the history
…ocess (#5803)
  • Loading branch information
LostKobrakai authored Dec 1, 2024
1 parent 2875c54 commit 8057acf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/phoenix/test/channel_test.ex
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ defmodule Phoenix.ChannelTest do
test "connect in a task" do
pid = self()
task = Task.async(fn ->
task = Task.async(fn ->
socket = socket(MyApp.UserSocket, "user_id", %{some: :assign}, test_process: pid)
broadcast_from!(socket, "default", %{"foo" => "bar"})
assert_push "default", %{"foo" => "bar"}
Expand Down Expand Up @@ -478,6 +478,10 @@ defmodule Phoenix.ChannelTest do

@doc """
Emulates the client leaving the channel.
By default this will crash the test process. Run
`Process.unlink(socket.channel_pid)` before this to prevent
this from happening. See [Leave and close](#module-leave-and-close).
"""
@spec leave(Socket.t) :: reference()
def leave(%Socket{} = socket) do
Expand All @@ -487,6 +491,10 @@ defmodule Phoenix.ChannelTest do
@doc """
Emulates the client closing the socket.
By default this will crash the test process. Run
`Process.unlink(socket.channel_pid)` before this to prevent
this from happening. See [Leave and close](#module-leave-and-close).
Closing socket is synchronous and has a default timeout
of 5000 milliseconds.
"""
Expand Down

0 comments on commit 8057acf

Please sign in to comment.