Move tests to js file