Scala.js与门面类型匹配

时间:2017-01-24 15:35:49

标签: scala scalatest scala.js

我无法使用使用带有Three.js外观的Scala.js的匹配器进行基本测试。以下代码打印错误" scala.scalajs.js.JavaScriptException:TypeError:无法读取属性' isArray__Z' of null"。

import org.denigma.threejs.Vector3
import org.scalatest.{FlatSpec, Matchers}

class TestVector extends FlatSpec with Matchers {
  "Vector" should "work" in {
    val v000 = new Vector3(0, 0, 0)
    v000 should be (v000)
  }
}

GitHub分享的完整项目。

我想它必须与facaded本机类型相关,因为在Scala中定义的类的测试工作正常。

我没有发现有关Scala.js和匹配器的任何记录。我错过了一些明显的东西吗?

完成错误的堆栈跟踪:

[info] - should work *** FAILED ***
[info]   scala.scalajs.js.JavaScriptException: TypeError: Cannot read property 'isArray__Z' of null
[info]   at scala.runtime.ScalaRunTime$.isArrayClass(W:\Test\JSTest\target\scala-2.11\jstest-test-fastopt.js:19470:14)
[info]   at scala.runtime.ScalaRunTime$.isArray(W:\Test\JSTest\target\scala-2.11\jstest-test-fastopt.js:19461:32)
[info]   at org.scalatest.Assertions$.areEqualComparingArraysStructurally(W:\Test\JSTest\target\scala-2.11\jstest-test-fastopt.js:30299:29)
[info]   at org.scalatest.words.BeWord$$anon$15.apply(W:\Test\JSTest\target\scala-2.11\jstest-test-fastopt.js:26853:49)
[info]   at org.scalatest.Matchers$ShouldMethodHelper$.shouldMatcher(W:\Test\JSTest\target\scala-2.11\jstest-test-fastopt.js:8592:29)
[info]   at org.scalatest.Matchers$AnyShouldWrapper.should(W:\Test\JSTest\target\scala-2.11\jstest-test-fastopt.js:8523:115)
[info]   at {anonymous}()(W:\Test\JSTest\target\scala-2.11\jstest-test-fastopt.js:54138:20)
[info]   at scala.scalajs.runtime.AnonFunction0.apply(W:\Test\JSTest\target\scala-2.11\jstest-test-fastopt.js:29505:23)
[info]   at org.scalatest.OutcomeOf$class.outcomeOf(W:\Test\JSTest\target\scala-2.11\jstest-test-fastopt.js:2911:7)
[info]   at org.scalatest.Transformer.apply(W:\Test\JSTest\target\scala-2.11\jstest-test-fastopt.js:37772:10)

0 个答案:

没有答案