Skipper.TestId (skipper_core v1.0.0)

Copy Markdown View Source

Test ID helpers: relative/path > part1 > part2, matched case-insensitively.

Summary

Functions

Build an ID from a file path (made relative to the project root) and title parts.

Canonical form for lookups: trim, lowercase, collapse whitespace.

Outermost ancestor of start whose mix.exs is an umbrella (apps_path), else the nearest directory with a mix.exs, else start. Cached.

Make file relative to the project root, with / separators.

Functions

build(file, parts)

@spec build(Path.t(), [String.t()]) :: String.t()

Build an ID from a file path (made relative to the project root) and title parts.

normalize(id)

@spec normalize(String.t()) :: String.t()

Canonical form for lookups: trim, lowercase, collapse whitespace.

project_root(start \\ nil)

Outermost ancestor of start whose mix.exs is an umbrella (apps_path), else the nearest directory with a mix.exs, else start. Cached.

relative(file)

Make file relative to the project root, with / separators.