diff options
Diffstat (limited to 'tst')
-rw-r--r-- | tst/email.spec.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tst/email.spec.ts b/tst/email.spec.ts index e966030..79c21cc 100644 --- a/tst/email.spec.ts +++ b/tst/email.spec.ts @@ -32,6 +32,7 @@ const getMocks = () => { getMailboxLock: mock(() => Promise.resolve(lock)), messageDelete: mock(() => Promise.resolve(true)), logout: mock(() => Promise.resolve()), + mailboxClose: mock(() => Promise.resolve()), }; const mockDependencies: Partial<EmailJobDependencies> = { @@ -116,6 +117,7 @@ test("releases lock on left", async () => { TE.mapLeft(() => { expect(imap.getMailboxLock).toHaveBeenCalledTimes(1); expect(lock.release).toHaveBeenCalledTimes(1); + expect(imap.mailboxClose).toHaveBeenCalledTimes(1); expect(imap.logout).toHaveBeenCalledTimes(1); }), )(); @@ -133,6 +135,7 @@ test("releases lock on right", async () => { expect(imap.getMailboxLock).toHaveBeenCalledTimes(1); expect(lock.release).toHaveBeenCalledTimes(1); expect(imap.logout).toHaveBeenCalledTimes(1); + expect(imap.mailboxClose).toHaveBeenCalledTimes(1); }), TE.mapLeft(() => expect(false).toBeTruthy()), )(); |