0

I am using intellij 2018 . I have dumped scalatest libraries through build.sbt and I could see libraries in external dependencies in project.

libraryDependencies += "org.scalatest" %% "scalatest" % "3.3.0-SNAP2" % Test

But when I import scalatest library in class it is showing not resolved.

how to make this work ?

import org.scalatest.flatspec.AnyflatSpec

Lavanya varma
  • 75
  • 1
  • 9
  • Have you tried compiling with the sbt shell? If it compiles, try to invalidate the Intellij cache. Sometimes Intellij behaves strangely because of a corrupted cache. – Badr Jun 17 '21 at 05:43
  • I tried to build project but the compilation failed . with Error:(2, 12) object scalatest is not a member of package org import org.scalatest.flatspec.AnyflatSpec – Lavanya varma Jun 17 '21 at 07:12
  • I don't think I understand. Did you remove scalatest from your project? Are you planning to use it through your other dependencies? If so then it won't work https://stackoverflow.com/a/15656543/4099089 – michaJlS Jun 17 '21 at 07:31
  • Sorry. unfortunately I have created test class in project/src/main/scala folder instead of project/src/test/scala . That's why it didn't work. Everything is fine After moving test class to project/src/test/scala folder . – Lavanya varma Jun 17 '21 at 10:05

0 Answers0