Skip to content

Commit

Permalink
workaround exunit bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed Feb 27, 2024
1 parent 586a935 commit cb5315a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion apps/debug_adapter/lib/debug_adapter/exunit_formatter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,20 @@ defmodule ElixirLS.DebugAdapter.ExUnitFormatter do

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

{:invalid, test_module = %ExUnit.TestModule{state: {:failed, failures}}} ->
{:invalid, test_module = %ExUnit.TestModule{}} ->
# Invalid (when setup_all fails)
failures =
case test_module.state do
nil ->
# workaround exunit bug
# https://github.com/elixir-lang/elixir/issues/13373
# TODO remove when we require elixir >= 1.17
[]

{:failed, failures} ->
failures
end

formatter_cb = fn _key, value -> value end

message =
Expand Down

0 comments on commit cb5315a

Please sign in to comment.