Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing with chrome using scala-js-env-playwright with esmodules and … #151

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ lazy val website = project
)

lazy val laminar = project.in(file("."))
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.enablePlugins(ScalaJSPlugin)
.settings(
libraryDependencies ++= Seq(
"com.raquo" %%% "airstream" % Versions.Airstream,
Expand Down Expand Up @@ -135,17 +135,16 @@ lazy val laminar = project.in(file("."))
"-no-link-warnings" // Suppress scaladoc "Could not find any member to link for" warnings
),

(Test / parallelExecution) := false,

(Test / requireJsDomEnv) := true,

(installJsdom / version) := Versions.JsDom,

(webpack / version) := Versions.Webpack,
(Test / parallelExecution) := true,

(startWebpackDevServer / version) := Versions.WebpackDevServer,

useYarn := true,
jsEnv := new jsenv.playwright.PWEnv(
browserName = "chromium",
headless = true,
showLogs = false
),
scalaJSLinkerConfig ~= {
_.withModuleKind(ModuleKind.ESModule)
},

scalaJSUseMainModuleInitializer := true,

Expand Down Expand Up @@ -174,6 +173,7 @@ lazy val laminar = project.in(file("."))
)
),
(Test / publishArtifact) := false,
Test / scalaJSStage := FullOptStage,
pomIncludeRepository := { _ => false },
sonatypeCredentialHost := "s01.oss.sonatype.org",
sonatypeRepository := "https://s01.oss.sonatype.org/service/local"
Expand Down
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
libraryDependencies += "io.github.gmkumar2005" %% "scala-js-env-playwright" % "0.1.11"
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.14.0")

addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.21.1")
Expand Down
6 changes: 3 additions & 3 deletions src/test/scala/com/raquo/laminar/StyleReceiverSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ class StyleReceiverSpec extends UnitSpec {
expectNode(div.of(backgroundImage is "", "Yo"))

urlBus.emit(url1)
expectNode(div.of(backgroundImage is "url(/example.png)", "Yo"))
expectNode(div.of(backgroundImage is "url(\"/example.png\")", "Yo"))

urlBus.emit(url2)
expectNode(div.of(backgroundImage is "url(https://example.com)", "Yo"))
expectNode(div.of(backgroundImage is "url(\"https://example.com\")", "Yo"))

urlBus.emit(url3)
expectNode(div.of(backgroundImage is "url(foo.jpg)", "Yo"))
expectNode(div.of(backgroundImage is "url(\"foo.jpg\")", "Yo"))
}

}
2 changes: 1 addition & 1 deletion src/test/scala/com/raquo/laminar/basic/StyleSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class StyleSpec extends UnitSpec {
))
expectNode(
span.of(
backgroundImage is """url(example.jpg)"""
backgroundImage is """url("example.jpg")"""
)
)
unmount()
Expand Down