Suite • opensavvy.prepared.suite.assertions • log
log¶
Logs a value in the test output.
Example¶
This function is especially useful if you use Power Assert, as it allows displaying intermediary values of a complex expression.
To enable Power Assert, follow these steps then add:
powerAssert {
functions = listOf(
// …Add any other function you want to instrument…
"opensavvy.prepared.suite.assertions.log",
)
}
Then, in your tests:
You can use this function to get more context about complex expressions when a test fails.
Logs a value in the test output, with some additionalInfo.
Example¶
This function is especially useful if you use Power Assert, as it allows displaying intermediary values of a complex expression.
To enable Power Assert, follow these steps then add:
powerAssert {
functions = listOf(
// …Add any other function you want to instrument…
"opensavvy.prepared.suite.assertions.log",
)
}
Then, in your tests:
You can use this function to get more context about complex expressions when a test fails.
Parameters¶
- additionalInfo
-
A lambda that generates a
Stringthat will be printed alongside the message.