Skip to content

Commit

Permalink
Update docs with steps to config preferred_cli_env
Browse files Browse the repository at this point in the history
  • Loading branch information
nandofarias authored and lpil committed Nov 3, 2021
1 parent 695af62 commit 6fde412
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ onwards:
# mix.exs
def deps do
[
{:mix_test_watch, "~> 1.0", only: :dev, runtime: false}
{:mix_test_watch, "~> 1.0", only: [:dev, :test], runtime: false}
]
end
```
Expand All @@ -36,7 +36,23 @@ For Elixir 1.3 and earlier:
# mix.exs
def deps do
[
{:mix_test_watch, "~> 1.0", only: :dev}
{:mix_test_watch, "~> 1.0", only: [:dev, :test]}
]
end
```

Optionally, add `preferred_cli_env: ["test.watch": :test]` for running `mix test.watch` in `:test` env by default.
It prevents the task from running `:dev` env config scripts.

```elixir
# mix.exs
def project do
[
...
preferred_cli_env: [
"test.watch": :test
],
...
]
end
```
Expand Down

0 comments on commit 6fde412

Please sign in to comment.