Skip to content

Commit

Permalink
Fix #36: Could not call Config.resolve in Scalajs (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekrich authored Nov 22, 2019
1 parent 9589f8a commit 8721a39
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
21 changes: 21 additions & 0 deletions sconfig/js/src/test/scala/ConfigFactoryTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}

0 comments on commit 8721a39

Please sign in to comment.