Reporting

Report module contains test reporters.

create_reporter : Str, ReporterCallback err -> ReporterDefinition err

Creates a custom reporter.

custom_reporter = Reporting.create_reporter("myCustomReporter", |results, _meta|
    len_str = results |> List.len |> Num.to_str
    index_file = { file_path: "index.html", content: "<h3>Test count: $(lenStr)</h3>" }
    test_file = { file_path: "test.txt", content: "this is just a test" }
    [index_file, test_file]
)

rename : ReporterDefinition err, Str -> ReporterDefinition err

Rename an existing reporter. The name of a reporter is also used to create the report dir in outDir.

custom_reporter =
    Reporting.BasicHtmlReporter.reporter
    |> Reporting.rename("myCustomReporter")

html_encode : Str -> Str

Encode Str so it can be used in HTML.

Useful util when writing a custom reporter.