improving javascript tests