Skip to content

Commit 407e10a

Browse files
authored
feat: respect :assert_receive_timeout config (#21)
1 parent 50544fc commit 407e10a

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

lib/gen_lsp/test.ex

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,11 @@ defmodule GenLSP.Test do
175175
})
176176
```
177177
"""
178-
defmacro assert_result(id, pattern, timeout \\ 100) do
178+
defmacro assert_result(
179+
id,
180+
pattern,
181+
timeout \\ Application.get_env(:ex_unit, :assert_receive_timeout)
182+
) do
179183
quote do
180184
assert_receive %{
181185
"jsonrpc" => "2.0",
@@ -215,7 +219,11 @@ defmodule GenLSP.Test do
215219
})
216220
```
217221
"""
218-
defmacro assert_error(id, pattern, timeout \\ 100) do
222+
defmacro assert_error(
223+
id,
224+
pattern,
225+
timeout \\ Application.get_env(:ex_unit, :assert_receive_timeout)
226+
) do
219227
quote do
220228
assert_receive %{
221229
"jsonrpc" => "2.0",
@@ -244,7 +252,11 @@ defmodule GenLSP.Test do
244252
})
245253
```
246254
"""
247-
defmacro assert_notification(method, pattern, timeout \\ 100) do
255+
defmacro assert_notification(
256+
method,
257+
pattern,
258+
timeout \\ Application.get_env(:ex_unit, :assert_receive_timeout)
259+
) do
248260
quote do
249261
assert_receive %{
250262
"jsonrpc" => "2.0",

0 commit comments

Comments
 (0)