How to use ScalaTest library


I was watching a tutorial about using this plugin in IDEA ( and there was a mention about adding ScalaTest library to a project.
But I can't find ScalaTest library in my dependencies. I've installed latest Scala plugin for Intellij IDEA 13, and it's said on plugins page ( that it has "built-in support for JUnit, ScalaTest".
But I can't use it! How can I add it to my dependencies? I'm a complete beginner in Scala and know nothing about Java and all that Java stuff, so I have no idea how to do it.

Please, can someone tell me, step by step, how to install/enable ScalaTest support? (I've spent hours googling the answer, but didn't find anything, even on jetbrains web site).


Comment actions Permalink

ScalaTest does not come automatically with Intellij. The best way to add ScalaTest library is done by sbt.
Most probably in your build.sbt file you need to add following:

If you run Intellij 13, then you may directly import your sbt file. If not, you can run "sbt gen-idea" that creates an intellij idea project automatically, then you can open this project directly under intellij.

Comment actions Permalink

Thank you for your reply. This will probably help (will try it later), but in the tutorial video ScalaTest library was simply added via GUI: create project then open Project Structure dialog, select Modules, then Dependencies tab, click add Library and ScalaTest was there (screenshot from tutorial video):


and here what I have:

So, should I install ScalaTest on my machine and import it to Intellij IDEA somehow to make it available in this dialog?

Comment actions Permalink

I never try, you can probably do that way, which is actually not recommended. Use SBT just like Maven to Java, which helps you to manage your project structure and resolve dependencies etc.
Intellij does have built in support for ScalaTest, but that doesn't mean it is there ready to use.
I'd suggest follow the steps from:

Comment actions Permalink

Thank you, Jiangong.

Finally, following your last link I found how to include ScalaTest library from Maven repository.


Please sign in to leave a comment.