Can't run Scalatest with Gradle

前端 未结 5 438
醉梦人生
醉梦人生 2021-02-02 09:28
task scalaTest(dependsOn: testClasses) << {
    description = \'Runs Scalatest suite\'
    ant.taskdef(name: \'scalatest\',
            classname: \'org.scalatest.         


        
5条回答
  •  南方客
    南方客 (楼主)
    2021-02-02 09:39

    rarry is correct. And even better, you can annotate a base test class with @RunWith(classOf[JUnitRunner]) once to cause all of your ScalaTest tests to run with the JUnit runner (assuming they extend the base class), e.g.:

    import org.junit.runner.RunWith
    import org.scalatest._
    import org.scalatest.junit.JUnitRunner
    
    @RunWith(classOf[JUnitRunner])
    abstract class UnitSpec extends FlatSpec with Matchers
    

提交回复
热议问题