lhns / munit-tagless-final   0.3.0

Apache License 2.0 GitHub

Integration library for MUnit and any effect type via cats-effect

Scala versions: 3.x 2.13 2.12
Scala.js versions: 1.x

munit-tagless-final

Test Workflow Release Notes Maven Central Apache License 2.0 Scala Steward badge

Integration library for MUnit and any effect type via cats-effect.

This project is based on typelevel/munit-cats-effect.

build.sbt

// use this snippet for cats-effect 3 and the JVM
libraryDependencies += "de.lhns" %% "munit-tagless-final" % "0.3.0" % Test

// use this snippet for cats-effect 3 and JS, or cross-building
libraryDependencies += "de.lhns" %%% "munit-tagless-final" % "0.3.0" % Test

Example

Cats Effect 3

import cats.effect.{IO, unsafe}

import scala.concurrent.Future

abstract class CatsEffectSuite extends TaglessFinalSuite[IO] {
  override protected def toFuture[A](f: IO[A]): Future[A] = f.unsafeToFuture()(unsafe.IORuntime.global)
}

Monix

import monix.eval.Task
import monix.execution.Scheduler

import scala.concurrent.Future

abstract class TaskSuite extends munit.TaglessFinalSuite[Task] {
  override protected def toFuture[A](f: Task[A]): Future[A] = f.runToFuture(Scheduler.global)
}

License

This project uses the Apache 2.0 License. See the file called LICENSE.