fix bugs in JS test framework