# `LexCredo.Check.Warning.NoEnumAllAssert`
[🔗](https://github.com/sippy-platform/lex_credo/blob/main/lib/lex_credo/check/warning/no_enum_all_assert.ex#L1)

## Basics

> #### This check is disabled by default. {: .neutral}
>
> [Learn how to enable it](`e:credo:config_file.html#checks`) via `.credo.exs`.

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

## Explanation

Avoid `assert Enum.all?/2` in test files. Use `for` with individual
assertions instead.

`assert Enum.all?(collection, predicate)` only tells you that at least one
element failed. A `for` loop with individual `assert` calls pinpoints the
exact failing element, making failures much easier to diagnose.

    # BAD — only tells you something failed, not which element
    assert Enum.all?(posts, &match?(%Post{}, &1))

    # GOOD — reports exactly which element failed
    for post <- posts, do: assert %Post{} = post

## Check-Specific Parameters

Use the following parameters to configure this check:

### `:exclude_test_files`

  When `true`, skips test files (effectively disabling this check). Default: `false`.

*This parameter defaults to* `false`.

## General Parameters

Like with all checks, [general params](`e:credo:check_params.html`) can be applied.

Parameters can be configured via the [`.credo.exs` config file](`e:credo:config_file.html`).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
