View Source A11yAudit.Assertions (A11y Audit v0.2.2)

ExUnit assertions

Summary

Functions

Asserts that the given audit results have no violations.

Types

@type opts() :: [
  filter: module() | nil,
  violations_print_limit: integer() | :infinity,
  nodes_per_violation_print_limit: integer() | :infinity,
  node_html_print_limit: integer() | :infinity
]

Functions

Link to this function

assert_no_violations(results, opts \\ [])

View Source
@spec assert_no_violations(A11yAudit.Results.t(), opts()) :: nil | no_return()

Asserts that the given audit results have no violations.

Options

  • :filter - A module implementing the A11yAudit.ViolationFilter behavior that will be used to exclude violations matching the filter from the results. Defaults to nil (no excluded violations).
  • :violations_print_limit - The maximum number of violations that will be printed in the error when the assertion fails. Can be an integer or :infinity. Defaults to :infinity.
  • :nodes_per_violation_print_limit - The maximum number of nodes that will be printed for each violation when the assertion fails. Can be an integer or :infinity. Defaults to 5.
  • :node_html_print_limit - The maximum length of the HTML snippet that will be printed for each node when the assertion fails. Can be an integer or :infinity. Defaults to 100.