Failures
Weaver aggregates failures from all tests to output them after all the tests have finished
import weaver._
import cats.effect._
object MySuite extends SimpleIOSuite {
val randomUUID = IO(java.util.UUID.randomUUID())
pureTest("failing test 1") {
expect(1 >= 2)
}
}
object MyAnotherSuite extends SimpleIOSuite {
import scala.util.Random.alphanumeric
val randomString = IO(alphanumeric.take(10).mkString(""))
test("failing test 2") {
for {
x <- randomString
} yield check(x).traced(here)
}
def check(x : String) = expect(x.length > 10)
}
The report looks like this:
repl.MdocSessionMdocAppMySuite
- failing test 1 2ms
repl.MdocSessionMdocAppMyAnotherSuite
- failing test 2 4ms
*************FAILURES*************
repl.MdocSessionMdocAppMySuite
- failing test 1 2ms
assertion failed (multiple_suites_failures.md:18)
expect(1 >= 2)
repl.MdocSessionMdocAppMyAnotherSuite
- failing test 2 4ms
assertion failed (multiple_suites_failures.md:34)
(multiple_suites_failures.md:31)
def check(x : String) = expect(x.length > 10)
| | |
| 10 false
IsyVnYz7ai
Total 2, Failed 2, Passed 0, Ignored 0, Cancelled 0