Skip to content

Commit 6fde412

Browse files
nandofariaslpil
authored andcommitted
Update docs with steps to config preferred_cli_env
1 parent 695af62 commit 6fde412

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ onwards:
2525
# mix.exs
2626
def deps do
2727
[
28-
{:mix_test_watch, "~> 1.0", only: :dev, runtime: false}
28+
{:mix_test_watch, "~> 1.0", only: [:dev, :test], runtime: false}
2929
]
3030
end
3131
```
@@ -36,7 +36,23 @@ For Elixir 1.3 and earlier:
3636
# mix.exs
3737
def deps do
3838
[
39-
{:mix_test_watch, "~> 1.0", only: :dev}
39+
{:mix_test_watch, "~> 1.0", only: [:dev, :test]}
40+
]
41+
end
42+
```
43+
44+
Optionally, add `preferred_cli_env: ["test.watch": :test]` for running `mix test.watch` in `:test` env by default.
45+
It prevents the task from running `:dev` env config scripts.
46+
47+
```elixir
48+
# mix.exs
49+
def project do
50+
[
51+
...
52+
preferred_cli_env: [
53+
"test.watch": :test
54+
],
55+
...
4056
]
4157
end
4258
```

0 commit comments

Comments
 (0)