I have a series of tests in the same class all testing the same feature , how can I skip/ignore a single one e.g:
class FooTest(_system: ActorSystem) extends TestKit(_system)
with ImplicitSender
with WordSpecLike
with Matchers
{
implicit val timeout = Timeout(10.seconds)
def this() = this(ActorSystem("TESTActorSystem"))
"Service " should {
"test something" in {
OK
}
}
"test to be ignored " in{
"Not implemented" //ignore this test
}
}
I did use registerIgnoredTest("test to be ignored")
but I have to remove the in
. Is there more elegant solution ? like annotation
You are using
WordSpecLike
. InWordSpecLike
, to ignore a test, you should changein
intoignore
like"test to be ignored " ignore {...
.Different spec has different way to do it. If you were using
FlatSpec
, you could have annotated the withignore should
likeignore should "test to be ignored " in {...
.You can see
scalatest
tagging section for more details.