Mix.Tasks.Test
Run the tests for a project.
This task starts the current application, loads up
test/test_helper.exs and then requires all files matching the
test/**/_test.exs pattern in parallel.
A list of files can be given after the task name in order to select the files to compile:
mix test test/some/particular/file_test.exs
Command line options
--trace- run tests with detailed reporting. Automatically sets--max-casesto 1--max-cases- set the maximum number of cases running async--cover- the directory to include coverage results--force- forces compilation regardless of modification times--no-compile- do not compile, even if files require compilation--no-start- do not start applications after compilation--no-color- disable color in the output--include- skip tests that do not match the filter--exclude- skip tests that match the filter
Configuration
:test_paths- list of paths containing test files, defaults to["test"]. it is expected all test paths to contain atest_helper.exsfile:test_pattern- a pattern to load test files, defaults to*_test.exs:test_coverage- a set of options to be passed down to the coverage mechanism
Coverage
The :test_coverage configuration accepts the following options:
:output- the output for cover results, defaults to"cover":tool- the coverage tool
By default, a very simple wrapper around OTP's cover is used as a tool,
but it can be overridden as follows:
test_coverage: [tool: CoverModule]
CoverModule can be any module that exports start/2, receiving the
compilation path and the test_coverage options as arguments.
Summary
| run(args) | Callback implementation of |