Commit f81978b0 authored by nanahira's avatar nanahira

ReplySession: fix reject on event

parent 0c1f56b2
......@@ -58,7 +58,13 @@ export class ReplySession<
async waitForPattern(timeout = 0) {
const promises = [
this.emitPromise.then(() => this.midResolve(true)),
new Promise<void>(async (resolve) => {
try {
await this.emitPromise;
} catch (e) {}
this.midResolve(true);
resolve();
}),
this.midPromise,
];
if (timeout) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment