From 48190c5cee09af3511b5b98f2ce5d898bd825fed Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Tue, 17 Oct 2023 11:12:10 -0300 Subject: [PATCH] test: fix usage of deleteUser --- apps/meteor/tests/end-to-end/api/10-subscriptions.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/meteor/tests/end-to-end/api/10-subscriptions.js b/apps/meteor/tests/end-to-end/api/10-subscriptions.js index f547895eb8a45..531291a992162 100644 --- a/apps/meteor/tests/end-to-end/api/10-subscriptions.js +++ b/apps/meteor/tests/end-to-end/api/10-subscriptions.js @@ -236,7 +236,8 @@ describe('[Subscriptions]', function () { before(async () => { user = await createUser({ username: 'testthread123', password: 'testthread123' }); threadUserCredentials = await login('testthread123', 'testthread123'); - request + + const res = await request .post(api('chat.sendMessage')) .set(threadUserCredentials) .send({ @@ -244,14 +245,13 @@ describe('[Subscriptions]', function () { rid: testChannel._id, msg: 'Starting a Thread', }, - }) - .end((_, res) => { - threadId = res.body.message._id; }); + + threadId = res.body.message._id; }); - after((done) => { - deleteUser(user).then(done); + after(async () => { + await deleteUser(user); }); it('should mark threads as read', async () => {