This commit is contained in:
parent
2e450aea97
commit
f8777a6adf
@ -21,7 +21,7 @@ interface ImapClientI {
|
|||||||
) => Promise<FetchMessageObject[]>;
|
) => Promise<FetchMessageObject[]>;
|
||||||
connect: () => Promise<void>;
|
connect: () => Promise<void>;
|
||||||
getMailboxLock: (mailbox: string) => Promise<MailboxLockObject>;
|
getMailboxLock: (mailbox: string) => Promise<MailboxLockObject>;
|
||||||
messageDelete: (uids: number[]) => Promise<boolean>;
|
messageDelete: (uids: number[], opts: any) => Promise<boolean>;
|
||||||
close: () => void;
|
close: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -257,8 +257,7 @@ export const perform = (
|
|||||||
// cleanup.
|
// cleanup.
|
||||||
TE.bind("deleted", ({ imap, uid, mailboxLock }) =>
|
TE.bind("deleted", ({ imap, uid, mailboxLock }) =>
|
||||||
TE.tryCatch(
|
TE.tryCatch(
|
||||||
// () => imap.messageDelete([uid], { uid: true }),
|
() => imap.messageDelete([uid], { uid: true }),
|
||||||
() => imap.messageDelete([uid]),
|
|
||||||
ToErrorWithLock(mailboxLock),
|
ToErrorWithLock(mailboxLock),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -146,7 +146,7 @@ test("cleans up sent messages from inbox", async () => {
|
|||||||
perform(emailJob, mockDependencies),
|
perform(emailJob, mockDependencies),
|
||||||
TE.map(() => {
|
TE.map(() => {
|
||||||
expect(imap.messageDelete).toHaveBeenCalledTimes(1);
|
expect(imap.messageDelete).toHaveBeenCalledTimes(1);
|
||||||
expect(imap.messageDelete).toHaveBeenCalledWith([1]);
|
expect(imap.messageDelete).toHaveBeenCalledWith([1], { uid: true });
|
||||||
}),
|
}),
|
||||||
TE.mapLeft(() => expect(false).toBeTruthy()),
|
TE.mapLeft(() => expect(false).toBeTruthy()),
|
||||||
)();
|
)();
|
||||||
|
Loading…
Reference in New Issue
Block a user