Skip to main content

Failure Report Formatter

The failure report formatter is similar to the print formatter, but it only prints failures. It's useful when you want less verbose output that only prints if something goes wrong. Like with the print formatter, it shows log messages, callstacks, and failure info in its messages.

Failure report formatter output

Usage#

If you're using runSandwichWithCommandLineArgs, you can simply pass --print-failures and the failure report formatter will be selected.

If you're using the lower-level runSandwich, simply include the formatter in the optionsFormatters of your sandwich options.

import Test.Sandwich.Formatters.FailureReport
main :: IO ()
main = runSandwich options myTests
where
options = defaultOptions {
optionsFormatters = [SomeFormatter defaultFailureReportFormatter]
}

Configuration#

Like other formatters, you can adjust the visibility threshold. You can also change the log level and set whether or not to include callstacks.

You can see the configuration options in the documentation.