-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Add m command for max-failures (#116)
Adds a new `m` command for dynamically controlling the `--max-failures` option of `mix test`.
- Loading branch information
1 parent
8b7ac58
commit 13c5e55
Showing
10 changed files
with
150 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
defmodule MixTestInteractive.Command.MaxFailures do | ||
@moduledoc """ | ||
Specify or clear the maximum number of failures during a test run. | ||
Runs the tests with the given maximum failures if provided. If not provided, | ||
the max is cleared and the tests will run until completion as usual. | ||
""" | ||
use MixTestInteractive.Command, command: "m", desc: "set or clear the maximum number of failures" | ||
|
||
alias MixTestInteractive.Command | ||
alias MixTestInteractive.Settings | ||
|
||
@impl Command | ||
def name, do: "m [<max>]" | ||
|
||
@impl Command | ||
def run([], %Settings{} = settings) do | ||
{:ok, Settings.clear_max_failures(settings)} | ||
end | ||
|
||
@impl Command | ||
def run([max], %Settings{} = settings) do | ||
{:ok, Settings.with_max_failures(settings, max)} | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters