Fix to js tests under phantoms