Skip to content

Commit

Permalink
Use CE 3.4 API directly
Browse files Browse the repository at this point in the history
CE 3.4 no longer requires to convert `munitIOTimeout` into a `FiniteDuration`

See: typelevel#233
  • Loading branch information
mzuehlke committed May 24, 2024
1 parent 38f5375 commit 421c80e
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions core/src/main/scala/munit/CatsEffectSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,10 @@ abstract class CatsEffectSuite
{ case e: IO[_] =>
val unnestedIO = checkNestingIO(e)

// TODO cleanup after CE 3.4.0 is released
val fd = Some(munitIOTimeout).collect { case fd: FiniteDuration => fd }
val timedIO = fd.fold(unnestedIO) { duration =>
unnestedIO.timeoutTo(
duration,
IO.raiseError(new TimeoutException(s"test timed out after $duration"))
)
}
val timedIO = unnestedIO.timeoutTo(
munitIOTimeout,
IO.raiseError(new TimeoutException(s"test timed out after $munitIOTimeout"))
)

timedIO.unsafeToFuture()
}
Expand Down

0 comments on commit 421c80e

Please sign in to comment.