Convert tests into javascript