From 8721a3940753e9aa7dadd81bc5d429fb2d03058a Mon Sep 17 00:00:00 2001 From: Eric K Richardson Date: Thu, 21 Nov 2019 16:15:04 -0800 Subject: [PATCH] Fix #36: Could not call Config.resolve in Scalajs (#57) --- project/plugins.sbt | 2 +- .../src/test/scala/ConfigFactoryTests.scala | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 5d7fc245..99165dae 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,7 +2,7 @@ val crossVer = "0.6.1" val scalaJSVersion = Option(System.getenv("SCALAJS_VERSION")) .filter(_.nonEmpty) - .getOrElse("0.6.29") + .getOrElse("0.6.31") val scalaNativeVersion = Option(System.getenv("SCALANATIVE_VERSION")) .filter(_.nonEmpty) .getOrElse("0.3.9") diff --git a/sconfig/js/src/test/scala/ConfigFactoryTests.scala b/sconfig/js/src/test/scala/ConfigFactoryTests.scala index 9fc81e30..ef6a0d1c 100644 --- a/sconfig/js/src/test/scala/ConfigFactoryTests.scala +++ b/sconfig/js/src/test/scala/ConfigFactoryTests.scala @@ -24,4 +24,25 @@ class ConfigFactoryTests { assert(conf.getInt("maxColumn") == 100) assert(conf.getBoolean("project.git") == true) } + + @Test + def resolve: Unit = { + val configStr = + """ + |pattern-default-main = default + |core = { + | version: "0.1" + | extends: [ + | ${pattern-default-main} + | ] + |} + """.stripMargin + + val conf = ConfigFactory.parseString(configStr) + assert(conf.isResolved == false) + val rconf = conf.resolve() + assert(rconf.isResolved == true) + val pattern = rconf.getList("core.extends").get(0).unwrapped + assert(pattern == "default") + } }