Skip to content

Commit cb5315a

Browse files
committed
workaround exunit bug
elixir-lang/elixir#13373
1 parent 586a935 commit cb5315a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Diff for: apps/debug_adapter/lib/debug_adapter/exunit_formatter.ex

+13-1
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,20 @@ defmodule ElixirLS.DebugAdapter.ExUnitFormatter do
164164

165165
%{state | failure_counter: state.failure_counter + 1}
166166

167-
{:invalid, test_module = %ExUnit.TestModule{state: {:failed, failures}}} ->
167+
{:invalid, test_module = %ExUnit.TestModule{}} ->
168168
# Invalid (when setup_all fails)
169+
failures =
170+
case test_module.state do
171+
nil ->
172+
# workaround exunit bug
173+
# https://github.com/elixir-lang/elixir/issues/13373
174+
# TODO remove when we require elixir >= 1.17
175+
[]
176+
177+
{:failed, failures} ->
178+
failures
179+
end
180+
169181
formatter_cb = fn _key, value -> value end
170182

171183
message =

0 commit comments

Comments
 (0)