Current section

Files

Jump to
mix_test_interactive lib mix_test_interactive command failed.ex
Raw

lib/mix_test_interactive/command/failed.ex

defmodule MixTestInteractive.Command.Failed do
@moduledoc """
Run only failed tests.
Equivalent to `mix test --failed`.
"""
alias MixTestInteractive.{Command, Settings}
use Command, command: "f", desc: "run only failed tests"
@impl Command
def applies?(%Settings{failed?: false}), do: true
def applies?(_settings), do: false
@impl Command
def run(_args, settings) do
{:ok, Settings.only_failed(settings)}
end
end