From 61563b01df6c424df222dee75c57059335c52b79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 11 May 2023 18:44:22 -0400 Subject: [PATCH] test: digest --- test/user.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/test/user.js b/test/user.js index dc76f45fa8..0ca6debc4a 100644 --- a/test/user.js +++ b/test/user.js @@ -1490,21 +1490,19 @@ describe('User', () => { ], done); }); - it('should send digests', (done) => { + it('should send digests', async () => { const oldValue = meta.config.includeUnverifiedEmails; meta.config.includeUnverifiedEmails = true; - User.digest.execute({ interval: 'day' }, (err) => { - assert.ifError(err); - meta.config.includeUnverifiedEmails = oldValue; - done(); + const uid = await User.create({ username: 'digest' }); + await User.digest.execute({ + interval: 'day', + subscribers: [uid], }); + meta.config.includeUnverifiedEmails = oldValue; }); - it('should not send digests', (done) => { - User.digest.execute({ interval: 'month' }, (err) => { - assert.ifError(err); - done(); - }); + it('should not send digests', async () => { + await User.digest.execute({ interval: 'month' }); }); it('should get delivery times', async () => {