Testing Improvements
We’ve recently improved the support for Scala tests in IntelliJ IDEA 15 EAP a bit. Read on to find out more details.
Statically computed expressions in scalaTest/specs2/uTest2 test names are now supported, which means that along with string constants you can use constructions like immutable string variables, concatenation, substring, stripSuffix, stripPrefix, toLowerCase, replace, or trim.
scalaTest/specs2/uTest2 tests and their hierarchy is displayed in the File Structure view when you click Show scala tests.
Don’t forget that your feedback is always welcome in our discussion forum and issue tracker.
Develop with Pleasure!
Comments below can no longer be edited.
hepin says:
September 15, 2015wow ,great to have.
David Kowis says:
September 15, 2015Fantastic. Would this work for a list of strings, or mapping across a set of values? Or only just string concats right now?
Maksim Sobolevskiy says:
September 16, 2015Hi, David! Now it works only for concatenation and several hardcoded methods we’ve described (replace, substring etc.). Can you please make a ticket on our issue tracker and describe your wishes in detail?
It is the best way to get the functionality you would like to have.
Schmitt Christian says:
September 24, 2015Test improvments are cool, but as long as the Specs2 Testing doesn’t work all the time it’s aweful, it should definitly make more use of sbt, than the IntelliJ compiler.
On Play2 projects either JUnit and Specs2 /ScalaTest mostly fails inside the IDE, while it works on the console.
Maksim Sobolevskiy says:
September 25, 2015Hi, Christian!
Could you please share one example with us which doesn’t work?
And what version of Scala plugin do you use?
Aki Huttunen says:
November 3, 2015The test feature is great but it assumes that the test is named XxxTest but we are using the “standard” Specs2 way of naming them XxxSpec. Is there some way to configure this?
Peng Cheng says:
April 1, 2017I have a similar question: how to customize it?
Sometimes I have tests/specs inside a function or a loop and it won’t be recognized by the IDE. Can I declare the function that wraps it as a test?