KogenCredo.Check.Warning.NoGlobalTeardown (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

Tests must not delete or stop named, app-owned state.

Bad:

setup do
  :ets.delete(:app_cache)
end

Good: start a private instance, e.g. start_supervised!({Cache, name: unique_name}).

Check-Specific Parameters

Use the following parameters to configure this check:

:allowed_targets

Target names that tests may tear down.

This parameter defaults to [].

:case_templates

Map of case template module name => :inherit | :async | :serial.

This parameter defaults to %{}.

:included_files

Path globs of files to check.

This parameter defaults to ["test/**/*_test.exs"].

General Parameters

Like with all checks, general params can be applied.

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