ClientUtils.Check.JourneyCoverage (client_utils v0.6.6)

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

A journey is covered when its walk tests every stage, in order.

Each .code_my_spec/journeys/<slug>.yml has one test file under test/journeys/ that says which journey it walks:

@moduletag journey: "<slug>"

and one test per stage, tagged with the stage's id: and in the YAML's order, since a stage starts where the one before it ended:

@tag stage: "signs-in"
test "the newcomer registers and lands signed in", ctx do

Flagged: a journey with no test file, a stage with no test, a tag naming no stage of the journey, a stage out of order, a journey file that names no journey, and a stage's stories: id that no .code_my_spec/stories/*.yml has. A stage no walk can test is removed from the YAML.

Check-Specific Parameters

Use the following parameters to configure this check:

:journeys

The glob of the journey files.

This parameter defaults to ".code_my_spec/journeys/*.yml".

:stories

The glob of the story files; none found, no story is checked.

This parameter defaults to ".code_my_spec/stories/*.yml".

General Parameters

Like with all checks, general params can be applied.

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