Credo.Check.Warning.WrongTestFilename (Credo v1.7.17)

View Source

Basics

This check is enabled by default.

Learn how to disable it via .credo.exs.

This check has a base priority of high and works with any version of Elixir.

Explanation

Invoking mix test from the command line will run the tests in each file matching the pattern *_test.exs found in the test directory of your project.

(from the ex_unit docs)

This test ensures that files containing use ExUnit.Case and related cases are only used in files ending with _test.exs.

If you have a file named differently (say, test_my_module.exs), you will be able to run mix test test/test_my_module.exs and see the tests run. This can mislead you into believing that subsequently running the full test suite (mix test) will also test your file.

Check-Specific Parameters

There are no specific parameters for this check.

General Parameters

Like with all checks, general params can be applied.

Parameters can be configured via the .credo.exs config file.