sbt: disable testing in certain sub-modules

471 views Asked by At

My project has several module, like

  • server (JVM)
  • sharedJVM
  • sharedJS
  • client (JS)

At the moment testing does only work for the JVM modules.

What I can do is:

sbt sharedJVM/test server/test

What I want do is:

sbt test

I couldn't find a Setting to do this.

1

There are 1 answers

1
Pritam Kadam On BEST ANSWER

You can take advantage of aggregatedProjects as below:

lazy val aggregatedProjects: Seq[ProjectReference] = Seq(
  server,
  sharedJVM
)

lazy val root = project
  .in(file("."))
  .aggregate(aggregatedProjects: _*)

Once you do this, then whatever command you execute at root project level will be propagated to aggregated projects. Which means by running sbt test will execute sbt server/test and sbt sharedJVM/test