Skip to content

Commit

Permalink
dom testing with jsdom
Browse files Browse the repository at this point in the history
..but had to go without modules scala-js/scala-js-env-jsdom-nodejs#56
  • Loading branch information
xko committed May 23, 2023
1 parent 124491f commit b81e21e
Show file tree
Hide file tree
Showing 6 changed files with 518 additions and 25 deletions.
32 changes: 12 additions & 20 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
import org.scalajs.linker.interface.ModuleSplitStyle
import org.scalajs.linker.interface.ModuleSplitStyle.*

lazy val sueppchen = project.in(file("."))
.enablePlugins(ScalaJSPlugin) // Enable the Scala.js plugin in this project
.settings(
scalaVersion := "3.2.2",
.enablePlugins(ScalaJSPlugin) // Enable the Scala.js plugin in this project
.settings(
scalaVersion := "3.2.2",
libraryDependencies += "com.raquo" %%% "laminar" % "15.0.1",

scalaJSUseMainModuleInitializer := true,
scalaJSUseMainModuleInitializer := true,
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.ESModule)
.withModuleSplitStyle(SmallModulesFor(List("sueppchen"))) },

/* Configure Scala.js to emit modules in the optimal way to
* connect to Vite's incremental reload.
* - emit as many small modules as possible for classes in the "sueppchen" package
* - emit as few (large) modules as possible for all other classes
*/
scalaJSLinkerConfig ~= {
_.withModuleKind(ModuleKind.ESModule)
.withModuleSplitStyle(
ModuleSplitStyle.SmallModulesFor(List("sueppchen")))
},

libraryDependencies += "com.raquo" %%% "laminar" % "15.0.1",


)
libraryDependencies += "org.scalatest" %%% "scalatest" % "3.2.16" % "test",
Test / jsEnv := new org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv(),
Test / scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.NoModule).withModuleSplitStyle(FewestModules) },
)
Loading

0 comments on commit b81e21e

Please sign in to comment.