Skip to content

Commit

Permalink
Update requirejs to 2.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
scala-steward authored and mkurz committed Aug 17, 2024
1 parent 90506da commit 765e3a7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ versionScheme := Some("semver-spec")

libraryDependencies ++= Seq(
"org.playframework" %% "play" % playVersion % "provided",
"org.webjars" % "requirejs" % "2.3.6",
"org.webjars" % "requirejs" % "2.3.7",
"org.webjars" % "webjars-locator" % "0.52",
"org.playframework" %% "play-test" % playVersion % "test",
"org.playframework" %% "play-specs2" % playVersion % "test",
Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/org/webjars/play/RequireJSSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class RequireJSSpec extends PlaySpecification {
status(result) must equalTo(OK)
contentType(result) must beSome(MimeTypes.JAVASCRIPT)
contentAsString(result) must contain("return [\n '/' + webJarId")
contentAsString(result) must contain("\"requirejs\":\"2.3.6\"")
contentAsString(result) must contain("\"requirejs\":\"2.3.7\"")
}
}
"produce a setup using a cdn" in new WithApplication(_.configure("webjars.use-cdn" -> "true")) {
Expand Down
14 changes: 7 additions & 7 deletions src/test/scala/org/webjars/play/WebJarsUtilSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class WebJarsUtilSpec extends PlaySpecification {
val webJarsUtil = app.injector.instanceOf[WebJarsUtil]

val requireJsPath = webJarsUtil.locate("require.js")
requireJsPath.path must beASuccessfulTry("requirejs/2.3.6/require.js")
requireJsPath.path must beASuccessfulTry("requirejs/2.3.7/require.js")
}
}
"be able to locate an asset with a webjar specified" in new WithApplication {
Expand Down Expand Up @@ -58,21 +58,21 @@ class WebJarsUtilSpec extends PlaySpecification {
"url" in new WithApplication {
override def running() = {
val webJarsUtil = app.injector.instanceOf[WebJarsUtil]
webJarsUtil.locate("requirejs/2.3.6/require.js").url must beASuccessfulTry("/requirejs/2.3.6/require.js")
webJarsUtil.locate("requirejs", "requirejs/2.3.6/require.js").url must beASuccessfulTry("/requirejs/2.3.6/require.js")
webJarsUtil.locate("requirejs/2.3.7/require.js").url must beASuccessfulTry("/requirejs/2.3.7/require.js")
webJarsUtil.locate("requirejs", "requirejs/2.3.7/require.js").url must beASuccessfulTry("/requirejs/2.3.7/require.js")
webJarsUtil.locate("asdf1234qwer4321").url must beAFailedTry
}
}
"url with a cdn" in new WithApplication(_.configure("webjars.use-cdn" -> "true")) {
override def running() = {
val webJarsUtil = app.injector.instanceOf[WebJarsUtil]
webJarsUtil.locate("require.js").url must beASuccessfulTry("https://cdn.jsdelivr.net/webjars/org.webjars/requirejs/2.3.6/require.js")
webJarsUtil.locate("require.js").url must beASuccessfulTry("https://cdn.jsdelivr.net/webjars/org.webjars/requirejs/2.3.7/require.js")
}
}
"url with a custom cdn" in new WithApplication(_.configure("webjars.use-cdn" -> "true", "webjars.cdn-url" -> "http://asdf.com")) {
override def running() = {
val webJarsUtil = app.injector.instanceOf[WebJarsUtil]
webJarsUtil.locate("require.js").url must beASuccessfulTry("http://asdf.com/org.webjars/requirejs/2.3.6/require.js")
webJarsUtil.locate("require.js").url must beASuccessfulTry("http://asdf.com/org.webjars/requirejs/2.3.7/require.js")
}
}
"generate a script tag from a partial WebJar path" in new WithApplication {
Expand Down Expand Up @@ -168,7 +168,7 @@ class WebJarsUtilSpec extends PlaySpecification {
val requireJs = webJarsUtil.requireJs(Call("GET", "/assets/js/app"))

requireJs.body must contain("""<script src="/_requirejs" ></script>""")
requireJs.body must contain("""<script src="/requirejs/2.3.6/require.min.js" data-main="/assets/js/app" ></script>""")
requireJs.body must contain("""<script src="/requirejs/2.3.7/require.min.js" data-main="/assets/js/app" ></script>""")
}
}
"generate a requireJs config with a cdn" in new WithApplication(_.configure("webjars.use-cdn" -> "true")) {
Expand All @@ -178,7 +178,7 @@ class WebJarsUtilSpec extends PlaySpecification {
val requireJs = webJarsUtil.requireJs(Call("GET", "/assets/js/app"))

requireJs.body must contain("""<script src="/_requirejs" ></script>""")
requireJs.body must contain("""<script src="https://cdn.jsdelivr.net/webjars/org.webjars/requirejs/2.3.6/require.min.js" data-main="/assets/js/app" ></script>""")
requireJs.body must contain("""<script src="https://cdn.jsdelivr.net/webjars/org.webjars/requirejs/2.3.7/require.min.js" data-main="/assets/js/app" ></script>""")
}
}
}
Expand Down

0 comments on commit 765e3a7

Please sign in to comment.