OptimumCredo.Check.Warning.AsyncFalseWithoutComment (OptimumCredo v0.5.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

async: false serialises the suite. Keep tests async and isolate the one test that needs global state; when async: false is truly required, say why in a comment.

Bad:

use MyApp.DataCase, async: false

Good:

# Mutates the global application env
use MyApp.DataCase, async: false

Check-Specific Parameters

Use the following parameters to configure this check:

:require_comment

When true (default) a comment suppresses the issue; when false every async: false is reported.

This parameter defaults to true.

:case_suffix

Only use of modules whose last segment ends with this suffix.

This parameter defaults to "Case".

:exempt_moduletag

A @moduletag atom that exempts the whole file (false disables).

This parameter defaults to :timing.

General Parameters

Like with all checks, general params can be applied.

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