diff options
Diffstat (limited to 'examples/scala-js/examples/testing/src/test')
-rw-r--r-- | examples/scala-js/examples/testing/src/test/scala/CollectionTest.scala | 17 | ||||
-rw-r--r-- | examples/scala-js/examples/testing/src/test/scala/ElementCreatorTest.scala | 24 |
2 files changed, 0 insertions, 41 deletions
diff --git a/examples/scala-js/examples/testing/src/test/scala/CollectionTest.scala b/examples/scala-js/examples/testing/src/test/scala/CollectionTest.scala deleted file mode 100644 index a586ca2..0000000 --- a/examples/scala-js/examples/testing/src/test/scala/CollectionTest.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.scalajs.js -import scala.scalajs.js.Dynamic.global -import scala.scalajs.js.JSConverters._ - -import org.scalajs.jasminetest.JasmineTest - -object CollectionTest extends JasmineTest { - - describe("Array") { - - it("should be able to map and filter integers") { - val array = Array(5, 7, 2, 6, -30, 33, 66, 76, 75, 0) - val result = array.filter(_.toInt % 3 != 0).map(x => x*x) - expect(result.toJSArray).toEqual(js.Array(25, 49, 4, 76*76)) - } - } -} diff --git a/examples/scala-js/examples/testing/src/test/scala/ElementCreatorTest.scala b/examples/scala-js/examples/testing/src/test/scala/ElementCreatorTest.scala deleted file mode 100644 index 43f6756..0000000 --- a/examples/scala-js/examples/testing/src/test/scala/ElementCreatorTest.scala +++ /dev/null @@ -1,24 +0,0 @@ -import scala.scalajs.js -import scala.scalajs.js.Dynamic.global - -import org.scalajs.jasminetest.JasmineTest - -object ElementCreatorTest extends JasmineTest { - - describe("ElementCreator") { - - it("should be able to create an element in the body") { - // create the element - ElementCreator.create() - - // jquery would make this easier, but I wanted to - // only use pure html in the test itself - val body = global.document.getElementsByTagName("body") - .asInstanceOf[js.Array[js.Dynamic]].head - - // the Scala.js DOM API would make this easier - expect(body.lastChild.tagName.toString == "H1").toBeTruthy - expect(body.lastChild.innerHTML.toString == "Test").toBeTruthy - } - } -} |