Skip to content

Commit 32082d1

Browse files
authored
Add ready to copy example in test_ignore_filters doc for frequent use case (#15070)
1 parent 45734fe commit 32082d1

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

lib/mix/lib/mix/tasks/test.ex

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,19 @@ defmodule Mix.Tasks.Test do
267267
ignored will emit a warning.
268268
269269
Mix ignores files ending in `_helper.exs` by default, as well as any file
270-
included in the project's `:elixirc_paths`. You may choose to disable all
271-
warnings by ignoring all files with `[fn _ -> true end]`.
270+
included in the project's `:elixirc_paths`.
271+
272+
For example, to ignore all files in a `test/support/` folder:
273+
274+
def project do
275+
[
276+
...,
277+
test_ignore_filters: [&String.starts_with?(&1, "test/support/")]
278+
]
279+
end
280+
281+
You may choose to disable all warnings by ignoring all files with
282+
`[fn _ -> true end]`.
272283
273284
Paths are relative to the project root and separated by `/`, even on Windows.
274285

0 commit comments

Comments
 (0)