For use in testing instead of a setTimeout callback.
it('will be called later', async function(done) {
let now = Date.now();
await delay(500);
// timing will probably be off by a few milliseconds
expect(Date.now() - now).toBeAbout(500);
done();
});