title: ScalaJS - SBT crossproject configuration for testing part of the `JS`-module on the JVM
body: <p>The <code>build.sbt</code> below is for a project where there 3 modules:</p>
  
  <ol>
  <li><code>Shared</code>-module 
  
  <ul>
  <li>compiles to the JS-platform and to the JVM-platform</li>
  <li>visible to the <code>JVM</code> module, to the <code>JS</code> module and to itself</li>
  </ul></li>
  <li><code>JVM</code>-module 
  
  <ul>
  <li>compiles to JVM-platform, </li>
  <li>not visible to <code>JS</code>-module, nor to <code>Shared</code>-module, only visible to itself</li>
  </ul></li>
  <li><code>JS</code>-module 
  
  <ul>
  <li>compiles to JS-platform </li>
  <li>not visible to <code>JVM</code>-module, nor to <code>Shared</code>-module, only visible to itself</li>
  </ul></li>
  </ol>
  
  <p>I would like to have a fourth module <code>TestJSonJVM</code> which compiles to both the JVM-platform and to the JS-platform and it is visible only to the <code>JS</code>-module and to itself.</p>
  
  <p>The purpose of the <code>TestJSonJVM</code>-module is to extract part of the <code>JS</code>-modul's logic/code into <code>TestJSonJVM</code>-module which makes it possible to test the extracted part on the JVM-platform (which has better tooling - (debuging, IDE integration, etc..) than the JS-platform for ScalaJS).</p>
  
  <p>How do I need to modify the <code>build.sbt</code> file below ? Such that this becomes possible ?</p>
  
  <pre><code>lazy val root = project
    .in(file("."))
    .aggregate(imJS, imJVM)
    .settings(
      scalaVersion := Settings.versions.scala,
      publish := {},
      publishLocal := {}
    )
  
  lazy val im = crossProject
    .in(file("."))
    .settings(
      libraryDependencies ++= Settings.sharedDependencies.value,
      addCompilerPlugin(
        "org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full),
      scalaVersion := Settings.versions.scala,
      name := "im",
      version := "0.1-SNAPSHOT"
    )
    .jvmSettings(
      libraryDependencies ++= Settings.jvmDependencies.value,
      mainClass in Test := Some("app.server.rest.TestHttpServerApp"),
      mainClass in Compile := Some("app.server.rest.TestHttpServerApp")
    )
    .jsSettings(
      mainClass in Compile := Some("app.client.Main"),
      libraryDependencies ++= Settings.scalajsDependencies.value,
      persistLauncher in Compile := true,
      persistLauncher in Test := false,
      jsDependencies += RuntimeDOM,
      scalaJSOptimizerOptions ~= { _.withDisableOptimizer(true) }
      )
  
  lazy val imJVM = im.jvm
  lazy val imJS = im.js
  
  persistLauncher in Compile := true
  
  persistLauncher in Test := false
  
  cancelable in Global := true
  </code></pre>