#2671 TestRunner bug

SlimerDude Sat 20 Jan

When running JS tests via compilerJs::TestRunner I believe there's a problem on line 220 which essentially says:

return engine.eval( ... ) -> toInt

Only eval() returns a java.lang.Integer and not a sys::Int so there is no toInt() method to invoke, raising the error:

sys::UnknownSlotErr: [java]java.lang::Integer.toInt
  fan.sys.JavaType.slot (JavaType.java:113)
  fan.sys.FanObj.doTrap (FanObj.java:187)
  fan.sys.FanObj.trap (FanObj.java:179)
  compilerJs::TestRunner.runTest (TestRunner.fan:220)
  compilerJs::TestRunner.runTests (TestRunner.fan:141)
  fan.sys.List.each (List.java:588)
  compilerJs::TestRunner.runTests (TestRunner.fan:138)
  compilerJs::TestRunner.main (TestRunner.fan:65)
  fan.sys.List.each (List.java:588)
  compilerJs::TestRunner.main (TestRunner.fan:65)

Note this error causes ALL the tests to fail.

matthew Mon 22 Jan

fant has been migrated to use Node.js as the underlying platform for running javascript tests instead of using the built-in Java JS engine (rhino/nashorn).

compilerJs::TestRunner should be considered deprecated for 1.0.70, and it will be removed in 1.0.71. If you want to run javascript tests using "raw" fantom invocation, use

fan compilerJs::NodeRunner

  NodeRunner [options] -test <pod>[::<test>[.<method>]]
  NodeRunner [options] -run <script>
  -keep      Keep intermediate test scripts

Login or Signup to reply.