Jump. CredoChecks. TooManyAssertions
(Jump.CredoChecks v0.3.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 normal and works with any version of Elixir.
Explanation
Tests with too many assertions are testing multiple concerns in a single test block. This makes failures harder to diagnose and tests harder to maintain.
Split large tests into focused sub-tests that each verify a single behavior.
Check-Specific Parameters
Use the following parameters to configure this check:
:max_assertions
Maximum number of assertions allowed per test block (default: 20).
This parameter defaults to 20.
General Parameters
Like with all checks, general params can be applied.
Parameters can be configured via the .credo.exs config file.