Huáng Jùnliàng 50e0e353ee Implement async-do-expressions transform (#13117)
Co-authored-by: Brian Ng <bng412@gmail.com>
2021-04-28 18:26:01 +02:00

6 lines
212 B
JavaScript

const x = async do { throw new Error("sync") };
expect(x).toBeInstanceOf(Promise);
x.then(() => { throw new Error("expected an error: sync is thrown.") })
.catch(err => { expect(err.message).toEqual("sync") });