Async Testing on the JVM and Scala.js
summary
ScalaTest 3.0 implements nonblocking tests by making test bodies return Future[Assertion] and adding async variants like AsyncFunSuite; assertions and matchers now return an Assertion marker, with new APIs such as recoverToExceptionIf/recoverToSucceededIf for exception testing and completeLastly for async cleanup. Scala.js forces this design because JavaScript cannot block, so a serial execution context and FutureOutcome wrapper coordinate callbacks. Migration requires a few breaking changes (withFixture moved down, timeLimits replacing timeouts) and the async approach works across JVM and JS.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 3:38The three rules
- 5:34The JavaScript bug
- 8:08Scala test implementation
- 11:08The impedance mismatch
- 16:15Inspectors in scale tests
- 27:18Puzzle
- 27:53Execution Context
- 29:25Override App
- 34:16Breaking Changes
- 37:43Questions
related talks
42mWhen all abstraction is lost
31mSCALATEST: YOU'RE ASSERTING IT WRONG
43mAsynchronous Selenium: How to Survive JS Testing
46mThe Essence of Testing
45mHow to Write Tests in 2021
44mParallelized And Concurrent Testing With Test::Async
17mMultiplatform Testing in Kotlin
25mMaking JavaScript Tests Fast, Easy, and Friendly
