ScalaTest in sbt: is there a way to run a single test without tags?

后端 未结 5 1740
不知归路
不知归路 2020-12-04 05:46

I know that a single test can be ran by running, in sbt,

testOnly *class -- -n Tag

Is there a way of telling sbt/scalatest to run a single

5条回答
  •  难免孤独
    2020-12-04 06:21

    I wanted to add a concrete example to accompany the other answers

    You need to specify the name of the class that you want to test, so if you have the following project (this is a Play project):

    You can test just the Login tests by running the following command from the SBT console:

    test:testOnly *LoginServiceSpec
    

    If you are running the command from outside the SBT console, you would do the following:

    sbt "test:testOnly *LoginServiceSpec"
    

提交回复
热议问题