Moving the js out of the test file