Skip to content
Permalink
Browse files

Add test for java.time linking errors on Scala.js

  • Loading branch information...
travisbrown committed Sep 10, 2019
1 parent c08fe0e commit 58e10dc35e4b5aec66a5252b4c259d4a175623b4
@@ -196,7 +196,7 @@ lazy val circeCrossModules = Seq[(Project, Project)](
(hygiene, hygieneJS)
)

lazy val circeJsModules = Seq[Project](scalajs)
lazy val circeJsModules = Seq[Project](scalajs, scalajsJavaTimeTest)
lazy val circeJvmModules = Seq[Project](benchmark, jawn)
lazy val circeDocsModules = Seq[Project](docs)

@@ -395,6 +395,15 @@ lazy val parser = parserBase.jvm
lazy val parserJS = parserBase.js

lazy val scalajs = circeModule("scalajs", mima = None).enablePlugins(ScalaJSPlugin).dependsOn(coreJS)
lazy val scalajsJavaTimeTest = circeModule("scalajs-java-time-test", mima = None)
.enablePlugins(ScalaJSPlugin)
.settings(noPublishSettings: _*)
.settings(
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest" % scalaTestVersion % Test
)
)
.dependsOn(coreJS)

lazy val scodecBase = circeCrossModule("scodec", mima = previousCirceVersion)
.settings(
@@ -0,0 +1,15 @@
package io.circe.no_java_time

import io.circe.{ Decoder, Encoder, Json }
import org.scalatest.FunSuite

class NoJavaTimeTest extends FunSuite {
test("Using Decoder should not throw linking errors") {
assert(Decoder[List[String]].decodeJson(Json.arr()) === Right(Nil))
}

test("Using Encoder should not throw linking errors") {
assert(Encoder[List[String]].apply(Nil) === Json.arr())
}
}

0 comments on commit 58e10dc

Please sign in to comment.
You can’t perform that action at this time.