Skip to content

Stack traces do not start in test method #425

@mwisnicki

Description

@mwisnicki
//> using dep org.scalameta::munit::1.1.0
//> using dep org.typelevel::munit-cats-effect::2.1.0

import cats.effect.IO
import munit.CatsEffectSuite

object Service {
  def op(): IO[String] = IO.delay(throw new Error("expected"))
}

class ServiceSpec extends CatsEffectSuite {
  test("call directly") {
    Service.op()
  }
}
% scala-cli test ServiceTest.scala
Compiling project (Scala 3.6.4, JVM (17))
Compiled project (Scala 3.6.4, JVM (17))
ServiceSpec:
==> X ServiceSpec.call directly  0.062s java.lang.Error: expected
    at Service$.op$$anonfun$1(ServiceTest.scala:8)
    at delay @ Service$.op(ServiceTest.scala:8)
    at flatMap @ munit.internal.NestingChecks$.checkNestingIO(internal.scala:38)

In practice it's not possible to navigate to failing test from stack trace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions