SNUnit

Cask

snunit-cask is Cask itself, compiled for Scala Native on top of snunit-undertow with a small patch. You write a normal Cask application:

//> using dep com.github.lolgab::snunit-cask::0.13.0

object MinimalApplication extends cask.MainRoutes {
  @cask.get("/")
  def hello() = "Hello World!"

  @cask.get("/hello")
  def hello(name: String) = s"Hello $name!"

  @cask.post("/do-thing")
  def doThing(request: cask.Request) = request.text().reverse

  initialize()
}

You can find an example in tests.

Differences from Cask on the JVM

The virtual thread executor of Cask 0.11 is disabled, because java.lang.invoke doesn’t exist on Scala Native. Requests always use the blocking handler.