Shampoo.Check.ProcessSleepInTest (shampoo v0.4.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 high and works with any version of Elixir.

Explanation

ETC-CORE-005: Wait on a message, monitor the process, or poll with a deadline. The default checks sleep statements in test, feature, property and setup blocks, including their inline branches and helpers that only sleep. Use scope: :all to include sleeps in other helpers and callbacks. For a deliberate sleep, use a Credo disable comment and write the reason. A literal :infinity is treated as a deliberate block.

Check-Specific Parameters

Use the following parameters to configure this check:

:scope

:test_flow checks test and setup statements. :all checks every finite sleep.

This parameter defaults to :test_flow.

:excluded_paths

Test paths to skip, relative to the Mix project.

This parameter defaults to ["test/support"].

General Parameters

Like with all checks, general params can be applied.

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