From 33cddfbd619c7eb54aaee14b51d03094db4ea86e Mon Sep 17 00:00:00 2001 From: Gabriel Grubba Date: Tue, 20 Dec 2022 10:42:39 -0300 Subject: [PATCH] tests: passwords - createUser hooks & createUser hooks --- packages/accounts-password/password_tests.js | 28 ++++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/accounts-password/password_tests.js b/packages/accounts-password/password_tests.js index c00d6d19e7..67cecc1729 100644 --- a/packages/accounts-password/password_tests.js +++ b/packages/accounts-password/password_tests.js @@ -1113,25 +1113,25 @@ if (Meteor.isServer) (() => { }); - Tinytest.add('passwords - createUser hooks', test => { - const username = Random.id(); - // should fail the new user validators - test.throws(() => Accounts.createUser( - {username: username, profile: {invalid: true}} - )); + Tinytest.addAsync('passwords - createUser hooks', async test => { + const username = Random.id(); + // should fail the new user validators + await test.throwsAsync( + async () => + await Accounts.createUser({ username: username, profile: { invalid: true } })); - const userId = Accounts.createUser({username: username, - testOnCreateUserHook: true}); + const userId = await Accounts + .createUser({ username: username, testOnCreateUserHook: true }); - test.isTrue(userId); - const user = Meteor.users.findOne(userId); - test.equal(user.profile.touchedByOnCreateUser, true); - }); + test.isTrue(userId); + const user = await Meteor.users.findOne(userId); + test.equal(user.profile.touchedByOnCreateUser, true); + }); - Tinytest.add( + Tinytest.addAsync( 'passwords - setPassword', - test => { + async test => { const username = Random.id(); const email = `${username}-intercept@example.com`;