ReferenceError:ok没有在Kotlin Javascript的QUnitAsserter.assertTrue中定义

Kotlin版本1.0.x-1.1.0支持使用QUnit的单元测试,但是当我加载测试时,它会引发这个异常:

ReferenceError: ok is not defined at QUnitAsserter.assertTrue_4mavae$ (file:///D:/neoranga/Mis%20documentos/GitHub/FibonacciCounter/app/build/classes/test/lib/kotlin-test-js.js:50:5) at assertTrue (file:///D:/neoranga/Mis%20documentos/GitHub/FibonacciCounter/app/build/classes/test/lib/kotlin-test-js.js:93:27) at QUnitAsserter.assertTrue_o10pc4$ (file:///D:/neoranga/Mis%20documentos/GitHub/FibonacciCounter/app/build/classes/test/lib/kotlin-test-js.js:47:5) at QUnitAsserter.Asserter.assertEquals_lzc6tz$ (file:///D:/neoranga/Mis%20documentos/GitHub/FibonacciCounter/app/build/classes/test/lib/kotlin-test-js.js:182:10) at assertEquals (file:///D:/neoranga/Mis%20documentos/GitHub/FibonacciCounter/app/build/classes/test/lib/kotlin-test-js.js:108:20) at AppTest.myFirstTest (file:///D:/neoranga/Mis%20documentos/GitHub/FibonacciCounter/app/build/classes/test/app_test.js:17:5) at Object.<anonymous> (file:///D:/neoranga/Mis%20documentos/GitHub/FibonacciCounter/app/build/classes/test/app_test.js:29:21) 

这是我的测试课:

 import org.junit.Test import kotlin.test.assertEquals class AppTest { @Test fun myFirstTest() { assertEquals(1, 1, "Test in test folder works") } } 

这是加载测试的html代码:

 <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Fibonacci Counter</title> <link rel="stylesheet" href="css/app.css"> <meta name="viewport" content="width=device-width"> <link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-2.1.1.css"> </head> <body> <div id="qunit"></div> <div id="qunit-fixture"></div> <footer id="info"> <p>Placeholder</p> </footer> <span id="text"></span> <script src="external_libs/jquery-3.1.1.min.js"></script> <script src="https://code.jquery.com/qunit/qunit-2.1.1.js"></script> <script src="lib/kotlin.js"></script> <script src="lib/kotlin-test-js.js"></script> <script src="app_main.js"></script> <script src="app_test.js"></script> </body> </html> 

问题是在QUnit 2.1.1版本中 ,通过使用版本1.23.1解决了问题。

这是用修正加载测试的html代码:

 <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Fibonacci Counter</title> <link rel="stylesheet" href="css/app.css"> <meta name="viewport" content="width=device-width"> <link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-1.23.1.css"> </head> <body> <div id="qunit"></div> <div id="qunit-fixture"></div> <footer id="info"> <p>Placeholder</p> </footer> <span id="text"></span> <script src="external_libs/jquery-3.1.1.min.js"></script> <script src="https://code.jquery.com/qunit/qunit-1.23.1.js"></script> <script src="lib/kotlin.js"></script> <script src="lib/kotlin-test-js.js"></script> <script src="app_main.js"></script> <script src="app_test.js"></script> </body> </html>