javascript code for running tests