fixing tests in javascript