diff options
author | Li Haoyi <haoyi@dropbox.com> | 2015-02-04 06:28:31 -0800 |
---|---|---|
committer | Li Haoyi <haoyi@dropbox.com> | 2015-02-04 06:28:31 -0800 |
commit | 3e92267b4f030f7bc7f0040fef50bd07e4709b21 (patch) | |
tree | e10900fcd96d9b6c8cc53e5b641bdd11ebfe59b8 /examples/crossBuilds/simple/js | |
parent | b094df4a6a6cf1bf7eeb36d842970aa8b3d94d5f (diff) | |
download | hands-on-scala-js-3e92267b4f030f7bc7f0040fef50bd07e4709b21.tar.gz hands-on-scala-js-3e92267b4f030f7bc7f0040fef50bd07e4709b21.tar.bz2 hands-on-scala-js-3e92267b4f030f7bc7f0040fef50bd07e4709b21.zip |
clientserver examples now work with crossProject
Diffstat (limited to 'examples/crossBuilds/simple/js')
-rw-r--r-- | examples/crossBuilds/simple/js/shared/test/scala/simple/SimpleTest.scala | 20 | ||||
-rw-r--r-- | examples/crossBuilds/simple/js/src/main/scala/simple/Platform.scala | 10 |
2 files changed, 21 insertions, 9 deletions
diff --git a/examples/crossBuilds/simple/js/shared/test/scala/simple/SimpleTest.scala b/examples/crossBuilds/simple/js/shared/test/scala/simple/SimpleTest.scala new file mode 100644 index 0000000..b348c6f --- /dev/null +++ b/examples/crossBuilds/simple/js/shared/test/scala/simple/SimpleTest.scala @@ -0,0 +1,20 @@ +/*js/shared/test/scala/simple/SimpleTest.scala*/ +/*jvm/shared/test/scala/simple/SimpleTest.scala*/ +package simple +import utest._ +object SimpleTest extends TestSuite{ + val tests = TestSuite{ + 'format{ + 'nil - assert(Simple.formatTimes(Nil) == Nil) + 'timeZero - { + val timestamps = Seq(0L, 1L << 32) + val expected = Seq( + "1970-01-01T00:00:00", + "1970-02-19T17:02:47" + ) + val formatted = Simple.formatTimes(timestamps) + assert(formatted == expected) + } + } + } +}
\ No newline at end of file diff --git a/examples/crossBuilds/simple/js/src/main/scala/simple/Platform.scala b/examples/crossBuilds/simple/js/src/main/scala/simple/Platform.scala index d726ec1..d4a9554 100644 --- a/examples/crossBuilds/simple/js/src/main/scala/simple/Platform.scala +++ b/examples/crossBuilds/simple/js/src/main/scala/simple/Platform.scala @@ -2,16 +2,8 @@ package simple import scalajs.js -object Platform extends js.JSApp{ +object Platform{ def format(ts: Long) = { new js.Date(ts).toISOString() } - def main() = { - val times = Seq( - 0L, - 1L << 32 - ) - println("Running on JS! " + 1.0d) - println(Simple.formatTimes(times)) - } }
\ No newline at end of file |