Testing Improvements

Maksim Sobolevskiy

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.

TestNamesNew

scalaTest/specs2/uTest2 tests and their hierarchy is displayed in the File Structure view when you click Show scala tests.

TestStructNew

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.

7 Responses to Testing Improvements

  1. hepin says:

    September 15, 2015

    wow ,great to have.

  2. David Kowis says:

    September 15, 2015

    Fantastic. 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, 2015

      Hi, 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.

  3. Schmitt Christian says:

    September 24, 2015

    Test 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, 2015

      Hi, Christian!
      Could you please share one example with us which doesn’t work?
      And what version of Scala plugin do you use?

  4. Aki Huttunen says:

    November 3, 2015

    The 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?

  5. Peng Cheng says:

    April 1, 2017

    I 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?