View Source MixTestInteractive.Settings (mix test.interactive v3.2.0)

Interactive mode settings.

Keeps track of the current settings of MixTestInteractive.InteractiveMode, making changes in response to user commands.

Summary

Functions

Update settings to run all tests, removing any flags or filter patterns.

Assemble command-line arguments to pass to mix test.

Create a new state struct, taking values from the command line.

Update settings to only run failing tests.

Provide a list of file-name filter patterns.

Update settings to only run "stale" tests.

Return a text summary of the current interactive mode settings.

Toggle file-watching mode on or off.

Types

@type t() :: %MixTestInteractive.Settings{
  failed?: boolean(),
  initial_cli_args: [String.t()],
  list_all_files: (-> [String.t()]),
  patterns: [String.t()],
  stale?: boolean(),
  watching?: boolean()
}

Functions

@spec all_tests(t()) :: t()

Update settings to run all tests, removing any flags or filter patterns.

@spec cli_args(t()) :: {:ok, [String.t()]} | {:error, :no_matching_files}

Assemble command-line arguments to pass to mix test.

Includes arguments originally passed to mix test.interactive when it was started as well as arguments based on the current interactive mode settings.

@spec new([String.t()]) :: t()

Create a new state struct, taking values from the command line.

In addition to its own options, new/1 initializes its interactive mode settings from some of mix test's options (--failed, --stale, and any filename arguments).

@spec only_failed(t()) :: t()

Update settings to only run failing tests.

Corresponds to mix test --failed.

Link to this function

only_patterns(settings, patterns)

View Source
@spec only_patterns(t(), [String.t()]) :: t()

Provide a list of file-name filter patterns.

Only test filenames matching one or more patterns will be run.

@spec only_stale(t()) :: t()

Update settings to only run "stale" tests.

Corresponds to mix test --stale.

@spec summary(t()) :: String.t()

Return a text summary of the current interactive mode settings.

Link to this function

toggle_watch_mode(settings)

View Source
@spec toggle_watch_mode(t()) :: t()

Toggle file-watching mode on or off.