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())
simpleTest("failing test 1") {
expect(1 >= 2)
}
}
object MyAnotherSuite extends SimpleIOSuite {
import scala.util.Random.alphanumeric
val randomString = IO(alphanumeric.take(10).mkString(""))
simpleTest("failing test 2") {
for {
x <- randomString
} yield check(x).traced(here)
}
def check(x : String) = expect(x.length > 10)
}
The report looks like this:
MyAnotherSuite
- failing test 2 29ms
MySuite
- failing test 1 29ms
*************FAILURES*************
MyAnotherSuite
- failing test 2 29ms
assertion failed (multiple_suites_failures.md:34)
(multiple_suites_failures.md:31)
def check(x : String) = expect(x.length > 10)
| | |
| 10 false
Bv0gCdLeiz
MySuite
- failing test 1 29ms
assertion failed (multiple_suites_failures.md:18)
expect(1 >= 2)
Total 2, Failed 2, Passed 0, Ignored 0, Cancelled 0