Skip to content

Commit

Permalink
refactor(MongoMemoryReplSet): waitUntilRunning: shorten function
Browse files Browse the repository at this point in the history
  • Loading branch information
hasezoey committed Oct 12, 2020
1 parent 1ad5bdc commit 0fc27d6
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,7 @@ export class MongoMemoryReplSet extends EventEmitter {
return;
case MongoMemoryReplSetStateEnum.init:
// wait for event "running"
await new Promise((resolve) =>
this.once(MongoMemoryReplSetStateEnum.running, () => resolve())
);
await new Promise((res) => this.once(MongoMemoryReplSetStateEnum.running, res));
return;
case MongoMemoryReplSetStateEnum.stopped:
default:
Expand Down

0 comments on commit 0fc27d6

Please sign in to comment.