Port old JS Spec tests to Mocha

Two changes:

 - Port old JS Spec tests to Mocha
 - Fix a bug that i noticed while porting the tests



I would prefer to delete the test: no test is better than a red test which is ok to be red