KogenCredo.Check.Warning.TestHasNoAssertions (KogenCredo v0.1.0)

View Source

Basics

This check is disabled by default.

Learn how to enable it via .credo.exs.

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

Explanation

A test without an assertion passes whenever the code does not crash. Add an assertion about the result or side effect that the test name promises, or delete the test.

Check-Specific Parameters

Use the following parameters to configure this check:

:file_suffixes

Filename suffixes treated as test files.

This parameter defaults to ["_test.exs"].

:test_macros

Macros that define a test body.

This parameter defaults to [:test].

:assertion_helpers

Extra function names that count as assertions.

This parameter defaults to [].

:assertion_prefixes

Function-name prefixes that count as assertions.

This parameter defaults to ["verify", "expect", "flunk"].

:count_pattern_matches

Treat destructuring matches ({:ok, x} = f()) as assertions.

This parameter defaults to true.

General Parameters

Like with all checks, general params can be applied.

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