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 () => {