Skip to content

Commit dd2e0f6

Browse files
committed
Mention mix and testing conventions in ExUnit's doc
1 parent 23982f1 commit dd2e0f6

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

lib/ex_unit/lib/ex_unit.ex

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,25 @@ defmodule ExUnit do
6262
6363
## Integration with Mix
6464
65-
... (as yet unwritten content) ...
65+
Mix is the project management and build tool for Elixir. Invoking `mix test`
66+
from the command line will run tests in each file matching the pattern
67+
"*_test.exs" found in the `test` directory of your project.
68+
69+
By convention, you could also create a test_helper.exs file inside the
70+
`test` directory and put the code common to all tests there.
71+
72+
The minimum example of a test_helper.exs file would be:
73+
74+
# test/test_helper.exs
75+
ExUnit.start
76+
77+
Then, in each test file, require test_helper.exs before defining test modules
78+
(or cases):
79+
80+
# test/myproject_test.exs
81+
Code.require_file "test_helper.exs", __DIR__
82+
83+
# ... test cases follow
6684
6785
"""
6886

0 commit comments

Comments
 (0)