Trying to get ScalaTest working: “There are no tests to run” when doing “mvn test”

后端 未结 3 816
感情败类
感情败类 2020-12-29 12:13

Edit: I finally got it to work!!!

It needed a combination of JUnit in the pom.xml, and three statements in my .scala:

import org.junit.runner.RunWith         


        
3条回答
  •  抹茶落季
    2020-12-29 12:38

    If you're running on Maven, then you'll either have to annotate your test class(es) with

    @RunWith(classOf[JUnitRunner])
    

    This would require you having JUnit as a dependency. Or you could use the ScalaTest Maven Plugin (haven't used it myself though).

提交回复
热议问题