Skip to main content

Print Formatter

The print formatter gives traditional print output, similar to other test tools. The tree is printed from top to bottom, with each node of the test tree colored based on whether it succeeded or failed. It also shows information about failures and log messages.

Print Formatter output

Usage#

If you're using runSandwichWithCommandLineArgs, you can simply pass --print and the print 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.Print
main :: IO ()
main = runSandwich options myTests
where
options = defaultOptions {
optionsFormatters = [SomeFormatter defaultPrintFormatter]
}

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.

note

The print formatter works fine with parallel tests! It will always print from top to bottom as results become available, but don't worry -- if you have multiple threads they are still running in the background.