ScalaTest: Assert exceptions in failed futures (non-blocking)
[*] I know this is probably a bit late, but ScalaTest provides this feature out of the box (I believe since version 2) by mixing in the ScalaFutures trait, or using it directly in your test functions. Behold! test(“some test”) { val f: Future[Something] = someObject.giveMeAFuture ScalaFutures.whenReady(f.failed) { e => e shouldBe a [SomeExceptionType] } … Read more