diff --git a/plugin-server/tests/helpers/promises.ts b/plugin-server/tests/helpers/promises.ts index 4d92371bdbbfb..3abd8dc082553 100644 --- a/plugin-server/tests/helpers/promises.ts +++ b/plugin-server/tests/helpers/promises.ts @@ -13,3 +13,22 @@ export function createPromise(): MockPromise { return result as MockPromise } + +export class Event { + private promise: Promise + private resolve: () => void + + constructor() { + this.promise = new Promise((resolve) => { + this.resolve = resolve + }) + } + + public set() { + this.resolve() + } + + public async wait() { + return this.promise + } +}