cats-effect-testing icon indicating copy to clipboard operation
cats-effect-testing copied to clipboard

Use Global EC for CatsResource

Open bcarter97 opened this issue 1 year ago • 1 comments

Attempts to fix https://github.com/typelevel/cats-effect-testing/issues/300

Loosely based on https://github.com/scalatest/scalatest/blob/310197b73d61f832bdfc4f7c939dbfa689057c54/jvm/scalatest-test/src/test/scala/org/scalatest/BeforeAndAfterAllSpec.scala#L76

bcarter97 avatar Mar 09 '24 20:03 bcarter97

~Can't use the Global EC for Scala JS - don't have any experience with ScalaJS, should I follow the recommendation and use scala.scalajs.concurrent.JSExecutionContext.queue or is there a preferred method~

After changing to use JS Global EC, it seems a bunch of imports aren't working (to do with the Scalatest Eventually trait). This is required to check the Resource is shutdown correctly. I think it would be possible to add a rudimentary eventually impl that doesn't require the Eventually trait, but I'd like some clarification on the approach

bcarter97 avatar Mar 09 '24 22:03 bcarter97