Search code examples
scalascalatest

Scalatest problem : value FunSuite is not a member of org.scalatest


I'm trying to write a test for my project in Scala 3. I added Scalatest library as :

libraryDependencies ++= Seq( 
   ....
  "org.scalatest"           %% "scalatest"                  % "3.2.9"   % Test
)

I know my structure is right:

enter image description here

But it gives me error:

value FunSuite is not a member of org.scalatest - did you mean scalatest.funsuite? enter image description here

However, I used the same in another project and it works fine.


Solution

  • Thanks to @Johney

    The correct usage is as below (at least in scala 3.0.2):

    import org.scalatest.funsuite.*
    
    class TestParser extends AnyFunSuite {
    }
    

    Of course the tutorials such as Getting started with FunSuite are based using import org.scalatest.FunSuite but the right examples is here which also referred as a first mention of FunSuite in Getting started with FunSuite .