rewriting tests in js, with async