Reporting

Report module contains test reporters.

createReporter : Str, ReporterCallback err -> ReporterDefinition err

Creates a custom reporter.

customReporter = Reporting.createReporter "myCustomReporter" \results, _meta ->
    lenStr = results |> List.len |> Num.toStr
    indexFile = { filePath: "index.html", content: "<h3>Test count: $(lenStr)</h3>" }
    testFile = { filePath: "test.txt", content: "this is just a test" }
    [indexFile, testFile]

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.

customReporter =
    Reporting.BasicHtmlReporter.reporter
    |> Reporting.rename "myCustomReporter"

htmlEncode : Str -> Str

Encode Str so it can be used in HTML.

Useful util when writing a custom reporter.