Skip to content

Commit

Permalink
Clarify client startup behavior in tests (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
davydog187 authored Jun 2, 2024
1 parent eef5ef9 commit 5ee168c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/slipstream/socket_test.ex
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,21 @@ defmodule Slipstream.SocketTest do
the server. The remaining functions allow you to emulate actions on behalf
of a hypothetical server.
## Starting the client
When working with `accept_conect/1` and `connect_and_assert_join/5`, you may
either pass the name of the GenServer to test, or a pid. If starting the client
yourself, make sure that you pass the `test_mode?: true` option, otherwise the
Slipstream client will attempt to connect to the configured uri.
defmodule MyApp.MyClientTest do
use Slipstream.SocketTest
setup do
client = start_supervised!(MyApp.Myclient, uri: "wss://test.com", test_mode?: true)
%{client: client}
end
## Timeouts
The `assert_*` and `refute_*` macros from this module default to ExUnit
Expand Down

0 comments on commit 5ee168c

Please sign in to comment.